hi all i am trying to get my slime enemy to die, play animation dead, wait 4 seconds play animation revive and then come back to life.
what im looking for is a statement if revive animation has ended then come back to life
is there an if end: (do thing)
sorry new to coding
thanks
if $RayCast2D.is_colliding() == true:
is_dead = true
if $AnimatedSprite.animation != $AnimatedSprite.play("dead"):
$AnimatedSprite.play("dead")
if $AnimatedSprite.animation != $AnimatedSprite.play("dead"):
$CollisionPolygon2D.disabled = false
if is_dead == true:
$Timer.start()
func _on_Timer_timeout():
if $AnimatedSprite.animation != $AnimatedSprite.play("revive"):
$AnimatedSprite.play("revive")
if $AnimatedSprite.animation != $AnimatedSprite.play("revive"):
is_dead = false