how to play the death animation and then kill the enemy. please check my code and help .
func _process(delta):
if health <= 0:
$death_timer.start()
$AnimationPlayer.play("death")
func _on_death_timer_timeout(): # this is a signal timeout
queue_free()
please help