Area2d Body Entered signal gets triggered always when the game starts

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

If you want to see the project: Source on my Github account.

Project

This project is based on Wuppo, and it’s only for studies and doesn’t have a name yet. When I was developing the water physics, I saw the need to use an Area2D node.


Situation

So, I’m using Area2D and its Body Entered signal that verifies when the player hits the water.


Fu**ing Problem

The problem is that when i start the game, the signal gets triggered even if the player does not touch the water. I’ve been at it for weeks.

I appreciate if you can help me, guys.

:bust_in_silhouette: Reply From: kidscancode

There’s a StaticBody under Ground_R_1 that’s also overlapping the water area. That is what’s triggering the body_entered signal.

I didn’t see that. Thanks a lot, dude! You have my respect. :slight_smile:

André Pereira | 2019-05-19 18:43

As a tip, when you’re trying to troubleshoot, put print(body.name) in the connected function. That will help you find when it’s not the body you think it is.

kidscancode | 2019-05-19 18:49

This will help me a lot. Thanks for the tip.

André Pereira | 2019-05-19 18:55