0 votes

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")
Godot version Godot_v3.4.3
in Engine by (38 points)
edited by

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.