Animation not playing in correct spot

Godot Version

4.1

Question

Hello! I am making an 3d enemy that just sort of follows you around right now. I made a death animation for them, which plays when they run out of health. However, the animation plays at the center of the map, and not the area where the enemy died. How do I get the animation to play in the correct spot? Here is my code for the enemy damage and death animation:

func _on_area_3d_body_part_explode(dam):
health -= dam
if health <= 0:
death_anim.play(“Death”)
queue_free()

Sounds like the death animation changes the enemy node’s position, try changing the animation to only alter the visuals of the enemy, like changing a child node’s position instead.

Can you please describe the scene tree of the enemy and send a screenshot of the animation player?

1 Like

Thank you! This fixed the problem just fine.