- Home /
How do you make animations play upon keystroke?
Me and my friend are learning Unity, and we have run into a problem with animation.
I animated some arms in 3ds max to look like they shoot, and we can't get them to play when we press a key. We have setup everything like we would normally do with animations made inside Unity, and it usually works.
The hands are imported into our project as an .fbx file, and works fine. The animations play inside the preview window.
It gives an error saying something like " Unity can't find the animation "
Please bear in mind we have only used Unity for 2 days ^^
Thanks
are you sure put the animation in the animations array of the component?
$$anonymous$$ake sure the name of the animation and the string in script match. $$anonymous$$aybe there's a space at the end of your animation name?
Answer by ganesh.pingale · Jan 11, 2013 at 12:47 PM
First you have to add a Animation component from Component > Miscellaneous >Animation and add animation into array which you wand to add. see the image for refrence
[1]: /storage/temp/6580-capture.png
Your answer
![](https://koobas.hobune.stream/wayback/20220613090746im_/https://answers.unity.com/themes/thub/images/avi.jpg)