Godot Version4
Question
Every tutorial I found says to use _input_event(viewport, event, shape_idx). But it never executes for some reason. I guess it is because my tree looks like this:
- Control
- RigidBody2D
- CollisionShape2D
- RigidBody2D
As said in docs, _input_event accepts only unhandled events, and Control handles event before RigidBody. But in Godot there is no ability to manage event handling order!
I could write own functions for detecting a click. It would be easy to do for simple shapes such as circle and square, but I don’t think it is the smoothest solution (even for simple shapes, but I have some much more complex shapes)
So, how do you detect clicks on a RigidBody?