Hey there! I’m trying to connect area2D entered through code. The idea is to connect hit box(an area2D) to attack state, when player is on attack state. Right now, it is connecting but it is not triggering the function, the debugger didn’t find any mistakes. I first thought the issue might be with layers and z index, but apparently enemy can detect player.
Is your player an Area2D or a CharacterBody2D? area_entered will only detect other Area2D nodes, maybe you mean to use body_entered?
Also the function argument func _on_area_entered(Area2D) -> void: matches the type Area2D, you should avoid this by naming the argument something else like area, maybe you meant to give it the type of Area2D with a colon, like so
My player is a characterbody2D, and the hitbox(a child of the player) is an Area2D. I want the attack state to detect through the area entered signal of hit box, when a hurtbox(an area2D) enters.
The above line of code is below the if statement which connect the area2d entered function. I get this string printed in my console when ever I hit attack state. But yeah, I can’t say for sure! But how can I confirm it?