Godot Version
4.6.2
Question
so i want to program an enemy that changes hitboxes based on lifes, now thats not hard, but for some reason, not only does the function only execute the print, but the area is completely off, it’s supposed to be ON the enemy but it’s IN FRONT of the enemy (the editor image is for showing where the area should be and the game image is where the area activates)
func _on_area_body_entered(body: Node2D) -> void:
print("test")
lifes -= 1
body.sphit
Eanble Debug > Visible Collision Shapes to see what is happening with colliders at runtime.
The collision shape gets moved to the wrong spot
Try to determine what is moving it there.
I don’t know tbh, i managed to fix the function and variable not changing but other than that the only thing interacting with collision boxes are arrays
What does your scene tree look like?
You shouldn’t be having plain nodes in your character hierarchy because they’ll break the transformation compounding. Make hurtbox a Node2D.
what’s the differece? i use plain nodes as a way to group things together so they are easier to differentiate, isn’t a node 2d like a whole new instance in the same scene?
area won’t follow the character body if there’s a plain node between them. The plain node will break the inheritance of transformation.