#Player Collider not being detected by area signal while being detected otherwise.

6 messages · Page 1 of 1 (latest)

proud marsh
#

There is a small but important difference:
First you're checking for a body, then you are checking for an area

#

If the player is a solid physics object, like a Characterbody or Rigidbody, it will only trigger the body_entered signal or be recognized by get_overlapping_bodies()

#

The other signal area_entered checks if another area node entered this area

proud marsh
#

You can add
class_name Player
To the top of your player script and use
if area is Player
To detect if the incoming object is of that script type

#

Also I'm assuming you connected the body_entered signal to this function now, which is a bit confusing because its name and parameter variable area indicate to the reader you're checking for areas still 😉

#

But the player is a Characterbody obviously and if you used the auto-generated function that gets created when you connect the body_entered signal to the script via the editor the naming will better reflect what's going on internally