Enemy doesn't detect weapon collision?

Godot Version

Godot 4.3

Question

I created an enemy with a collision shape 2D and created an enemy with sprite collision. The latter doesn’t record when the weapon hits it, even though it’s set up identical to the former.

New user, so I can’t upload an attachment. Here’s the Github: GitHub - DatWolfKiba/aRPG: An aRPG created with Godot 4

If you need me to share code and screenshots, lmk

Your post does not contain enough information to help you. Please share your scene setup. How are your signals and your collision layers set up? What weapon are you referring to? The player weapon? How is it supposed to detect the collision? Are you using on_body_entered?

What are you trying to do? (show your node setup/code)

I created an enemy with a collision shape 2D and created an enemy with sprite collision. The latter doesn’t record when the weapon hits it, even though it’s set up identical to the former.

New user, so I can’t upload an attachment. Here’s the Github: GitHub - DatWolfKiba/aRPG: An aRPG created with Godot 4

Working & Broken Enemy setup: collision and mask later: 2, hitBox layer 3, hurtBox mask 3

Player: Layer 2, 3, 4

hurtBox layer 1 - mask 1 , 2 , 3

weapon layers 1, 2, 3, 4

ENEMY SCRIPT CODE:
func _on_animation_player_animation_finished(anim_name: StringName) → void: if anim_name == “death”: queue_free()

func _on_hurt_box_area_entered(body: Node2D) → void:
if area == $hitBox: return
take_damage()

func take_damage() → void:
health -= 1
if health <= 0: $hitBox.set_deferred(“monitorable”, false) # Disable hitbox upon death die()
die()

func die() → void:
is_dead = true
animations.play(“death”)
await animations.animation_finished # Wait for the death animation to complete queue_free() # Remove the boss from the scene

What is the expected result?

I want to be able to hit and kill the enemy, but I only collide and get hurt by them. I can’t seem to hurt them.

What is happening instead? (include any error messages)

The hit isn’t registered.

I haven’t used any signalrs for this. I just connected nodes

It won’t let me upload snapshots since I’m a new user