- Edited
I would like to understand why this doesn't work and the proper way to code this.
The $AnimatedSprite.play("Run") is the correct name of the animation.
I'm not worried about physics right now I'm just trying to get the animations
to respond with the keys.
func _physics_process(delta):
if Input.is_action_pressed("ui_right"):
$AnimatedSprite.play("Walk")
$AnimatedSprite.flip_h = false
elif Input.is_action_pressed("ui_right") and Input.is_action_pressed("Shift"):
$AnimatedSprite.play("Run")
elif Input.is_action_pressed("ui_left"):
$AnimatedSprite.play("Walk")
$AnimatedSprite.flip_h = true
else:
$AnimatedSprite.play("Idle")