• 2D
  • How to put Animations into 4-Way Movement Script?

Hello! I have an Issue with my movement script. I want to put in some moving animations, but when I put them into the actual script, they won't play. This is how I put it into the code, but it doesn't work when I put it this way. Does anybody have a solution to this? Thank you!

Never mind, I have figured out a way. I did take a more complicated way, I think, but it works. I just made a variable for all the directions, and made it so when I press an arrow key, it turns on the variable for the key I pressed, and turns off the other ones. Then in a _physics_process, I made it so if one of the variables equals true, it plays that animation. I think that my problem was that since the script runs every frame, it was resetting the animations every frame as well, making it just be stuck on one frame. I am sorry for the inconvenience of asking this question, when I had an easy way to do it myself.

Great to hear you found the solution. It's no inconvenience and hopefully the post may help someone else.