How do I make my sprite complete an animation whenever I press the A key?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By TheBiggestNoob

if Input.is_key_pressed(KEY_A):
print(“Attack is working”)
$Sprite.play(“Attack”)

So this is the code I used, and it does output “Attack is working”, whenever I press the A key, however the sprite just freezes and does nothing. It is really frustrating, I hope someone can help.

:bust_in_silhouette: Reply From: bodicpen

Hey there! Try using an AnimatedSprite rather than a Sprite. :slight_smile: