Hello everyone! I have an animated animation of AnimatedSprite2d in which my character begins to run 2 frames, and what I want is that as soon as this animation ends, another one starts in a loop but it does not work, the first animation instead of ending simply loops itself, I ask for your help, here is my code
func _on_AnimatedSprite_animation_finished():
if ($AnimatedSprite.animation == "run"):
$AnimatedSprite.play("running")
func anim_ctrl():
if velocity.x > 0:
$AnimatedSprite.flip_h = false
$AnimatedSprite.play("run")
elif velocity.x < 0:
$AnimatedSprite.flip_h = true
$AnimatedSprite.play("run")
else:
$AnimatedSprite.play("idle")