The so-called rear-end is only to see the role of the back, more typical of the assassin type, true three unique category.
This function is done under the Aniamtor system, and the following steps need to be prepared to complete this walking effect:
1. Drag into the idle action and blend tree,blend tree to mix left running, straight run, right run 3 action.
2. Define a float type variable speed as the toggle condition for the action: Idle->blend Tree (speed>0.1), blend tree, idle (speed<0.1)
3. Set a float type of direction,-1,0,1 for the 3 actions of the mixed tree as a left-running, straight-run, right-running threshold.
Finally, complete the following code
if(animator) {floatH = Input.getaxis ("Horizontal"); floatv = Input.getaxis ("Vertical"); //Set Animation transition conditionsAnimator. SetFloat (" Speed", h*h+v*v); Animator. SetFloat ("Direction", H, Directiondamptime, time.deltatime); }
The code is fairly brief and simple, and the threshold of the mixed tree corresponds exactly to the size of the horizontal axis, enabling a corresponding switch.
But here set speed when the h*h+v*v as the value of the switch I do not understand, I hope to understand the great God to teach you.
The moving of the role of Unity3d--the keyboard movement in rear-end view