Help with HITBOXES!

Godot Version

GODOT 4.2.1

Question

Hello!!
I’m here to request your help regarding Hitboxes in Godot. The issue is as follows: I have a projectile, which is a sword, and it has an Area2D with the CollisionShape configured. The same applies to the enemy scene; it also has an Area2D with the CollisionShape configured.

The layers have been set up as well:

I keep the enemy on “LAYER 3 - Enemies”.
The sword with the Mask set to “LAYER 3 - Enemies”.

Then, in the enemy’s Area2D, I set up the ‘on_area_entered’ signal to ‘queue_free()’, just to test if the collision was working. However, it’s not working.
The projectile simply passes through, and nothing happens, even though everything seems to be configured correctly. Do you have any ideas of what might be causing this?

it should be the other way around since the enemy trying to detect the sword not the sword detecting the enemy

2 Likes

So the enemy hurtbox needs to be in the mask of my projectile layer?

1 Like

yes sss