1, add animator Avatar.
A. Now change the file format of the project panel's animation file to humanoid,apply and then configure. If there is nothing to modify, just dot done. Change to apply a bit more done. Then click on Create panel and you will see that animator components already exist on the component of our character. Next, let's create a character state machine.
2, create the state machine.
To create a animator controller in the project panel, double-click the newly created new animator controller, the animator panel appears, and the animation we need is dragged into the panel for editing. The animated effect I do is that I want the character to move from a stationary state to a walking state and then transition from State.walk to State.idle. Right-click on the static (idle) state control, create a transition (make Transition), connect to the walk control (from Idle on the mouse freely to the left button on the walk), the same, right click on the Walk control Connect back to idle again.
How to add avatar and state machines in u3d