help with getting animation

i want to make a script that makes it so when i push a button i make an object animate (like the slide going back on a gun when fired) if some one could point me in the right way oh i only know javascript

This is fairly easy to do.

Question is do you wanna animate from a script on the object with the animation or from another script.

if you wanna make it from the object itself you can just:

> animation.Play("nameofanimation");  
> //With the ""

be sure that the animation is on that object tough.
and if you dont want to have it playing from the start, be sure to uncheck Play on Startup in the inspector.

if you want to play it from a script on another object you can:

> Transform.Find("objectname").animation.Play("animationname");

or put the object into a Transform variable if you dont want to go Transform.Find it all the time.

Hope it helps :slight_smile: