First, I would like to thank all the godot community members for their tools and clear support material.
However, I have a question about the behavior of the pause feature: why are some signals emitted at resuming?
I made a Minimal Working Example to reproduce the behavior that I am talking about. Here is the scene node tree (sorry my godot is in French):
The pause mode of the main Node is "Process", the one of the Area2D is "Stop" and the one of the CollisionShape2D is "Inherit".
The gdscript attached to the Main node is the following:
$Area2D.connect("mouse_entered", self, "_on_Area2D_mouse_entered")
if event is InputEventKey:
if event.scancode == KEY_ESCAPE and event.is_pressed():
get_tree().paused = not get_tree().paused
- When the mouse enters the CollisionShape2D, an output message "MOUSE_ENTERED" is printed.
- When the escape button is pressed, the game is paused. In that state, when the mouse enters the CollisionShape2D, nothing is printed.
That's okay, that's cool. However, when the mouse enters the CollisionShape2D at least once during the pause, the message "MOUSE_ENTERED" is printed when resuming (hitting escape again)**, even if the mouse is not in the CollisionShape2D when hitting escape**. Personaly, I find that kind of unexpected...
Do you have any idea about how to prevent "MOUSE_ENTERED" to be printed on resuming? I tried to disconnect the signal during the pause but it is not working...
Thank you for your time and attention,