![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | fartholomewTVG |
Hello!
I’ve been slowing teaching myself how to use Godot and have run into an issue animating my sprite
func _process (delta):
if Input.is_action_pressed("move_left"):
$AnimatedSprite.play("Move")
$AnimatedSprite.flip_h = true
if Input.is_action_pressed("move_right"):
$AnimatedSprite.play("Move")
$AnimatedSprite.flip_h = false
else:
$AnimatedSprite.play("Idle")
This is the code that I’m using to animate my character, without the “else”, it’ll act as intending, flipping the sprite and playing the walking animation, but the animation will just continuously play.
With the “else” statement at the end, only the right facing walking animation will play.
If I use the “else” statement on each “if Input.AnimatedSprite.Play()” line, the walking animation won’t play at all, just the Idle when the character isn’t moving
Any help would be appreciated, thank you!