Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Godotmus |
I have set KinematicBody2D Pickable to “On” and it has CollisionShape2D (circleshape) also. (KinematicBody2D script snip…)
func _input_event(viewport, event, shape_idx):
print(event) # never gets here..
if event is InputEventMouseButton and event.pressed and event.button_index == BUTTON_LEFT:
print("Pressed1")
emit_signal("left_click_down", self.get_parent())
elif event is InputEventMouseButton and event.pressed == false and event.button_index == BUTTON_LEFT:
print("Pressed2")
emit_signal("left_click_up", self.get_parent())
I had “exactly” same way done KinematicBody (3d) and it responsed fine to mouse clicks etc. Also my node structure is similar between working 3d and not working 2d
mouse_entered signal also does not work with KinematicBody2D
Edit:
I created similarly structured test project for this and in there KinematicBody2D _input_event worked fine… so it must be something in my code
Edit2:
From googling it looks like some other element eat events… I have not much else than background picture and label… (test sample did not have those) I thought events go through topmost object… looks like no??