Hi, im making a third person shooter, and then i got into this problem, where i have no idea on how to make the shoulder/hand bones rotate to face the center of the camera. I tried using the head look controller, but the bones reacted very wierd and has some issues with animations applied. I saw this thread : http://forum.unity3d.com/threads/41951-aim-bone-to-a-direction-%28quick-third-person-aim%29
, and i dont really understand what the answerer meant. I’m still a beginner at scripting, and would anyone help me to explain to me about this problem? I need serious help ![]()
This is the code from the user “cerebrate” from the thread :
horiRot = HeadLookController.AngleAroundAxis(transform.forward, fireTarget.position - transform.position, transform.up);
vertRot = HeadLookController.AngleAroundAxis(transform.forward, fireTarget.position - transform.position, transform.right);
horiRot = Mathf.Clamp(horiRot, -35, 35);
vertRot = Mathf.Clamp(vertRot, -35, 35);
horiRot = (horiRot /35);
vertRot = (vertRot /35);
aimUp.normalizedTime = -vertRot;
aimDown.normalizedTime = vertRot;
aimRight.normalizedTime = horiRot;
aimLeft.normalizedTime = -horiRot;
THANKS!