SHARE
TWEET

aim

a guest May 1st, 2018 155 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     void OnAnimatorIK(){
  2.  
  3.         if (activeIK == false) {
  4.             mAnimator.SetLookAtWeight (0, 0, 0, 0, 0);
  5.  
  6.         }
  7.         else {
  8.  
  9.             Vector3 vtarget = target.position;
  10.             vtarget.y = vtarget.y + aimAdjustment;
  11.             mAnimator.SetLookAtPosition (vtarget);
  12.             mAnimator.SetLookAtWeight (1, 1, 1, 1, 1);
  13.  
  14.             if (leftHandle != null) {
  15.                 mAnimator.SetIKPosition (AvatarIKGoal.LeftHand, leftHandle.transform.position);
  16.                 mAnimator.SetIKRotation (AvatarIKGoal.LeftHand, leftHandle.transform.rotation);
  17.                 mAnimator.SetIKPositionWeight (AvatarIKGoal.LeftHand, 1);
  18.                 mAnimator.SetIKRotationWeight (AvatarIKGoal.LeftHand, 1);
  19.             }
  20.  
  21.             if (rightHandle != null) {
  22.                 mAnimator.SetIKPosition (AvatarIKGoal.RightHand, rightHandle.transform.position);
  23.                 mAnimator.SetIKRotation (AvatarIKGoal.RightHand, rightHandle.transform.rotation);
  24.                 mAnimator.SetIKPositionWeight (AvatarIKGoal.RightHand, 1);
  25.                 mAnimator.SetIKRotationWeight (AvatarIKGoal.RightHand, 1);
  26.             }
  27.  
  28.         }
  29.            
  30.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top