|Topic was automatically imported from the old Question2Answer platform.
I have ships flying in a background. I want to be able to select the ship by clicking on it and then click on a map location to select the ship destination. However, when I click on the ship to select it, the even is also later captured by the root node (or the parent area2d if I’m using one).
I want that the background (root node or parent area2d) only gets the event if I didn’t click on a ship. How do I do that?
Would you mind sharing a bit more on this?
It would help to tell us what kind of node the ship is and what signals you are reacting to. Maybe the signal also emits a variable with the signal that you can check on, like CollisionObject2Ds input_event?
ipdramon | 2021-10-30 10:13
The ship is a kinneticbody2d, it contains a sprite and a collider2d. I was connecting to the input_event() of the kinnecticbody2d. I found a better solution and I posted the answer. below.
erebrus | 2021-10-30 11:12