duck

duck

Dec 9th, 2010
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.32 KB | None | 0 0
  1.  
  2. bool running = false;
  3.  
  4.  
  5. function Update () {
  6.    
  7.     bool lastRunningState = running;
  8.     running = (Mathf.Abs(Input.GetAxis("Horizontal")) > 0.1);
  9.    
  10.     if (lastRunningState != running) {
  11.         if (runnning) {
  12.             animation.CrossFade("Run");
  13.         } else {
  14.             animation.CrossFade("Idle");
  15.         }
  16.         lastRunningState = running;
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment