IK and Aiming
Hi There, I am trying to make my characters right hand look to aim point of camera. I have an object that looks the aim position.`rightHandIkTarget.parent.transform.LookAt(aimHelper.position);` it works well. Then I use these codes to make my right hand to look same point: void OnAnimatorIK() { anim.SetLookAtWeight(lookWeight, bodyWeight, headWeight, headWeight, clampWeight); Vector3 filterDirection = characterController.lookPosition; anim.SetLookAtPosition((overrideLookTarget != null) ? overrideLookTarget.position : filterDirection); if (leftHandIkTarget) { anim.SetIKPositionWeight(AvatarIKGoal.LeftHand, leftHandIkWeight); anim.SetIKPosition(AvatarIKGoal.LeftHand, leftHandIkTarget.position); anim.SetIKRotationWeight(AvatarIKGoal.LeftHand, leftHandIkWeight); anim.SetIKRotation(AvatarIKGoal.LeftHand, leftHandIkTarget.rotation); } if (rightHandIkTarget) { anim.SetIKPositionWeight(AvatarIKGoal.RightHand, rightHandIkWeight); anim.SetIKPosition(AvatarIKGoal.RightHand, rightHandIkTarget.position); anim.SetIKRotationWeight(AvatarIKGoal.RightHand, rightHandIkWeight); anim.SetIKRotation(AvatarIKGoal.RightHand, rightHandIkTarget.rotation); } }
But Right hand doesn't look to the aim position. Any Ideas ?