Mouse entered/exited not firing unless player object is below the object

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By powervette

I have a chest which is an Area2D set up to do mouse entered/exited and it works fine as long as my player is even with or below the chest, once moving above it the mouse entered/exited events stop firing. It kinda is acting like with other objects using a YSort, so I moved it out of the YSort and still the same behaviour.

Not sure what is going on

i dont understand: what do you mean with “even, below and above”? isnt this a 2D scene?
are you talking about the z_index property?

Andrea | 2021-01-05 18:55

sorry, if the player y position is above the chests y position it does not fire, if players y position is below chests then it works. Doesn’t matter x position, player can be on left edge of screen and chest on right, just as long as player y is below chest y it will fire.

powervette | 2021-01-05 19:01

understood now
first thing i can think of: the player has a “clickable” area and it is interfering with the area of the chest.

if not, you have to share parts of the code, because this is not a normal behaviour of the area2D enter/exit signal.

Andrea | 2021-01-05 19:14

Player has multiple Area2D’s, I turned off pickable just to see if that would matter, it didn’t. No clickable areas.

lots of code, not sure what to share.

powervette | 2021-01-05 19:26

wanna share the project or a reduced version of it?

Andrea | 2021-01-05 19:44

I can, but seeing as i’m pretty newbish its probably quite embarrassing.

any direct messaging here to send you a link?

powervette | 2021-01-05 19:48

dont be, being noob is the first step to became expert!

you can use google drive and put the link here, and remove it later if you wish

Andrea | 2021-01-05 19:53

link removed

powervette | 2021-01-05 19:54

:bust_in_silhouette: Reply From: Andrea

lol, it took me forever to realize: the player has a “GUI” control node which is invisible and that’s positionated on the bottom right, therefore when the player is on the top-left of the chest, the chest is not clickable.
Remove that GUI, or if you need it change the mouse_filter setting to pass

hhmmm, i try setting either or both of the control nodes on the player to pass and still the same problem, are you able to start the game and without moving, mouse over the chest and it highlights?

powervette | 2021-01-05 20:53

ya, definitely the control node, not sure why pass/ignore aren’t doing anything, it worked once I think. I dont think I need that big one, the small one I do but can size it down.

Thanks for helping me find that

powervette | 2021-01-05 21:01

sorry, the setting to use is not pass but ignore, and you have to apply it on both the GUI and the parent Control node, if i do this it works flawless.
Good job by the way!

Andrea | 2021-01-05 21:15

yes that works

thanks for the help, i’m sure it wont be the last thing I ask about

powervette | 2021-01-05 21:19