Scripted Mecanim Animations in Unity 3d

  • 6 years ago
In this video well go over how to use Javascript to script player inputs with Mecanim animations. This will be the last video in thisusing the MakeHuman model. Well start off with a blank animator window and create a new idle animation state with a new idle animation. Then well add in a walking animation state that will be ivated using a custom parameter that well create.\r
\r
The parameter will be called Walk and it will be ivated once the vertical input is present. Creating a transition from the idle to animation state, and back again. Next well add in a sprint animation and a new parameter called Sprint that will ivate once we press our left click button. Both of these parameters will be float values. After that well show you how to setup a blend tree which will use a combination of three different animations to blend different movements together.\r
\r
In our case we will use a blend tree to combine a forward walking animation clip with a right and left animation clip to seamless blend the motions together. The animation clips themselves arent perfect, but well manage to blend them in fairly well. Well then go over the scripting which is located below.using a custom parameter that well create. The parameter will be called Walk and it will be ivated once the vertical input is present. Creating a transition from the idle to animation state, and back again. Next well add in a sprint animation and a new parameter called Sprint that will ivate once we press our left click button. Both of these parameters will be float values.