How can I disable an Area2d the second time my player goes over it?

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

Hi. Okay, so I am making an educational version of Pacman, and I put an Area2d on a tile which is pretty much the zone and if the pacman enters the zone, a question will pop up. Once the question is answered the player can continue playing but the problem Im facing is that when my player goes over the zone again, the question pops up again. How can I disable the area2d the second time my player goes over the node?

:bust_in_silhouette: Reply From: CalmTurtle

Have a counter that increases every time the player passes through the rect. When the counter < 1 you can trigger the question, otherwise ignore the question.

:bust_in_silhouette: Reply From: eons

If you are using a signal, connections can be made “one shot”, that means that the connection will be cut when fired once.

That option is in the connection window and signal connection parameters.