Thanks, it was easier than I thought. StaticBody has the event handler and it can use Spatial (parent) function or variable (or even send signal to main script.. edit: actually no, signals are bit hard to connect with instantiated nodes..)
Couple of question still, I tried to move event handler to Spatial parent and it did not work..
(in staticbody)
func _input_event(camera, event, click_position, click_normal, shape_idx):
if (event is InputEventMouseButton and event.pressed and event.button_index == BUTTON_LEFT):
print("cell: " + str(self.get_parent().cell))
(in Spatial parent)
func _input_event(camera, event, click_position, click_normal, shape_idx):
if (event is InputEventMouseButton and event.pressed and event.button_index == BUTTON_LEFT):
print("cell: " + str(cell))
if I tried plain _input(event) then one click produced events from all instanced "ghost object", why is that working that way?
And more about editor, editor suggestions did not contain event.pressed and event.button_index or event.getbuttonindex()
I was wondering why InputEventMouseButton event does not contain these properties or functions... makes newbie godotter life harder :) Had to type them "blindly" and they worked..