0 votes

Hi, I am working on 8- way character animation.( I use AnimationPlayer)
I want it to be smooth - i.e. if last move was right and u move right again I want the animation to resume. I have read the docs and it says u can resume animation when u stop it with stop(false) but I dont really know how to stop it if it plays when u press a button(I tried stopping it with is_action_just_released but it plays the animation only once) . If there was a way to play an animation from specific I could use current_animation_position but I havent found one.

How can I handle it?


I tried

if Input.is_action_pressed("RIGHT"):
    input_direction.x += 1
    if last_animation == "right":
        animation_player.play()
    else:
        animation_player.play("right")
        last_animation = "right"
if Input.is_action_just_released("RIGHT"):
    animation_player.stop(false)
in Engine by (31 points)

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 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 webmaster@godotengine.org with your username.