Advertisement
Berenger

thatanimator's script

Jun 16th, 2012
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     function Update()
  2.     {
  3.         additiveBlend = GetComponent("AdditiveTest"); movement = GetComponent("UnityMovement"); states = GetComponent("States");
  4.  
  5.         blendValue += blendSpeed * Time.deltaTime;
  6.  
  7.         var Timer = GetComponent("Timer");
  8.         var controller : CharacterController = GetComponent(CharacterController);
  9.  
  10.         if(Climbing == true)
  11.         {
  12.             animation.Stop("runADD");
  13.             animation.Stop("runjump_air");
  14.             animation.Stop("runjump_airADD");
  15.             additiveBlend.leanRight.weight = 0;
  16.             additiveBlend.leanLeft.weight = 0;
  17.             print ("moving to climb");
  18.             transform.position = Vector3.Lerp (climbLocStart.position, climbLocEnd.position, blendValue);
  19.             transform.rotation = Quaternion.Lerp (climbLocStart.rotation, climbLocEnd.rotation, blendValue);
  20.             Timer.enabled = false;
  21.             state = 10;
  22.         }
  23.         if(Climbing == false){
  24.             blendValue = 0;
  25.         }
  26.  
  27.  
  28.         if(Input.GetButtonDown("Jump") && state == 10)
  29.         {
  30.             blendValue = 0;
  31.             Climbing = false;
  32.             transform.parent = null;
  33.             state = 3;
  34.             animation.CrossFade("runjump_start", 0.1);
  35.             transform.Translate(0, Time.deltaTime * 50, Time.deltaTime, Space.World);
  36.             additiveBlend.leanRight.weight = 1;
  37.             additiveBlend.leanLeft.weight = 1;
  38.         }
  39.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement