r/godot•
baksoBoy

Why is my script unable to detect when a body enters it?

Help

I made a signal for body_entered(body: Node2D) for a node that consists of a Area2D, with a Sprite2D and CollisionShape2D parented to it. I then have another node that is set up in the same way with an Area2D, Sprite2D and CollisionShape2D. I have made sure that the collision shapes are set up properly, however whenever a collision happens, the code isn't run inside of the _on_body_entered() function. The body_entered code resides within a node called "Enemy", where the details of the function say that Source: Enemy, Signal: body_entered, Target: Enemy.

What am I doing wrong? If more information is needed to help solve my issue then please tell me. Thanks.

Posted Oct 10, 2023, 8:42 PM UTC

15
Loading comments…