making animatedsprite go to specific frame after input is realised

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

i’ve been making my animatedsprite node move, and so far i have 8 - directional movement. the only problem is when i lift the key, the animation stops at the frame it was currently at. is there any way i can make it stop at a different frame like idle? would i have to make a new animation and code that or is there another way i can use?


:bust_in_silhouette: Reply From: CardboardComputers

If you are using AnimatedSprite, and the idle animation is just one frame, and the moving animations contain the frame you want, then you should be able to simply set the frame property to the idle frame whenever you stop moving. On the other hand, if you want actual idle animations, then you may need to make separate animations and switch to them using play.