- Home /
How to have SetLookAtPosition for head and body differently?
Hi guys, and all the Guru out there.
I have a 3rd Person character whose body is set tracking a certain direction using SetLookAtPosition.
Now i want the head to look in another object independent of the body.
Both targets are always moving, thats why i use IK
Thanks in advance.
Below is my sample code.
public Transform UpperBodyFacing;
public float BodyWeight = 1f;
public float HeadWeight = 0f;
public float EyesWeight = 0f;
public float ClampWeight = 0f;
void OnAnimatorIK (int LayerInd) {
// Set Spine Rotation
Anim.SetLookAtPosition (UpperBodyFacing.position);
Anim.SetLookAtWeight (1f, BodyWeight, HeadWeight, EyesWeight, ClampWeight);
}
Comment
Your answer
Follow this Question
Related Questions
Animation with bones, Limb Solver knee is bending in wrong way 1 Answer
How to move hips in Unity Animation Rigging IK 0 Answers
Animation is deforming mesh 0 Answers
Bowman/Archer Aim Animation 0 Answers
Maya and Unity integration question 0 Answers