Play animation when key is pressed

Need script that makes it so i can click a key to play an animation

Hello @Orange_Test_Room,

You can take a look in this tutorial:

When pressing the key P the animation will change. You can do something similar to start the animation on key press.

stop telling me to lloo at the tutorials i dont understand it can someone just make the script

I’ve observed that when you put forth an effort of you own, more people are willing to put forth extra effort to assist you. Do as you like, but that has worked fairly well for me on this forum.


its called being lazy

If you just did a little reading, you would be able to understand. It’s not that hard to click a few links and buttons to get to the script.

1 Like


Im saying to just use the link to the tutorial

i tried that it didnt work the also im not sure if the script works for 2d wich im using

If you’re using 2D, you have to switch using the sprite component. Animation blending is for 3D animations.

@Orange_Test_Room, to add to what @DevPlex01 said, check out the following guide on animated sprites -

If it still continues to not work, you can post the code you tried with, and then the community can help you out better.

Hope this helps!

seen it ive done exactly what should be riight but i have an idea