- Home /
How to play an animation?
i have my player in fps default player controler and copyed the scripts, everything works and the animations work for my player as i have a test one in the scene infrom of my player doing a runing animation and is just set to loop and do it forever.\
but how to i make my player do the walking animation when i press "w" or "s" or to jump and have his "jump" animation play? along with a "use" animation when i left click?
thanks in advance :)
I advise you to watch some tutorials before getting started if you really want to learn unity. Ow what the heck.
if(Input.Get$$anonymous$$ey("w"))
{
// Depends on how you want to move him you can use transform.Translate or many other ways...
animation.Play("walk");
}
if(Input.Get$$anonymous$$ey("space"))
{
animation.Play("jump");
}
i got the animations to work with CrossFade but they dont blend into one another they just snap idk how to fix that lol but yeah the problym that i had was that the code wasent in the mesh it was in the controler.
Answer by Negagames · May 08, 2013 at 11:26 PM
Truly, the best thing for you to do is to watch a tutorial like ahaykal suggested. Speaking of that, unity3d its self has a great tutorial on how to use Mecanim, the new animation system in unity: http://www.youtube.com/watch?v=Xx21y9eJq1U
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Can't use old Animation component 0 Answers
Blender Animations not working properly. 1 Answer