Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Update()
- {
- additiveBlend = GetComponent("AdditiveTest"); movement = GetComponent("UnityMovement"); states = GetComponent("States");
- blendValue += blendSpeed * Time.deltaTime;
- var Timer = GetComponent("Timer");
- var controller : CharacterController = GetComponent(CharacterController);
- if(Climbing == true)
- {
- animation.Stop("runADD");
- animation.Stop("runjump_air");
- animation.Stop("runjump_airADD");
- additiveBlend.leanRight.weight = 0;
- additiveBlend.leanLeft.weight = 0;
- print ("moving to climb");
- transform.position = Vector3.Lerp (climbLocStart.position, climbLocEnd.position, blendValue);
- transform.rotation = Quaternion.Lerp (climbLocStart.rotation, climbLocEnd.rotation, blendValue);
- Timer.enabled = false;
- state = 10;
- }
- if(Climbing == false){
- blendValue = 0;
- }
- if(Input.GetButtonDown("Jump") && state == 10)
- {
- blendValue = 0;
- Climbing = false;
- transform.parent = null;
- state = 3;
- animation.CrossFade("runjump_start", 0.1);
- transform.Translate(0, Time.deltaTime * 50, Time.deltaTime, Space.World);
- additiveBlend.leanRight.weight = 1;
- additiveBlend.leanLeft.weight = 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement