Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void OnAnimatorIK(){
- if (activeIK == false) {
- mAnimator.SetLookAtWeight (0, 0, 0, 0, 0);
- }
- else {
- Vector3 vtarget = target.position;
- vtarget.y = vtarget.y + aimAdjustment;
- mAnimator.SetLookAtPosition (vtarget);
- mAnimator.SetLookAtWeight (1, 1, 1, 1, 1);
- if (leftHandle != null) {
- mAnimator.SetIKPosition (AvatarIKGoal.LeftHand, leftHandle.transform.position);
- mAnimator.SetIKRotation (AvatarIKGoal.LeftHand, leftHandle.transform.rotation);
- mAnimator.SetIKPositionWeight (AvatarIKGoal.LeftHand, 1);
- mAnimator.SetIKRotationWeight (AvatarIKGoal.LeftHand, 1);
- }
- if (rightHandle != null) {
- mAnimator.SetIKPosition (AvatarIKGoal.RightHand, rightHandle.transform.position);
- mAnimator.SetIKRotation (AvatarIKGoal.RightHand, rightHandle.transform.rotation);
- mAnimator.SetIKPositionWeight (AvatarIKGoal.RightHand, 1);
- mAnimator.SetIKRotationWeight (AvatarIKGoal.RightHand, 1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement