Adjacent Area2Ds send mouse signals in the wrong order

Godot Version

4.2.1

Question

i’ve got two area2Ds next to each other that use mouse_entered and mouse_exited to turn a variable on and off. the variable needs to be on when i’m hovering over any kind of area2D. the problem is, when moving the mouse from one to the other, the exit for the first area2D sends a signal AFTER the enter to the other area2D, turning off the variable while i’m hovering over the other area2D.

even with timed delays, there’s a split second in between the exit and enter triggers being correct that can fuck up my code. is there a way to fix this?

You could instead use a integer and add +1 when a area entered and -1 when a area exits and then you just have to test if this integer is greater then 0

1 Like

knew it’d be something super simple like that that i wouldn’t be able to figure out on my own. that worked perfectly, thank you so much!

1 Like