I Have a Character that i want to apply the mouse look script to his spine to make him look up and down(bending over, leaning back) if i add an empty gameObject and place all cord,rotation to zero and place the spine inside i can achieve this but then the animation wont play above the spine with AddMixingTransform, How do i get the spine to act like the empty gameObject zeroed out retaining the animations yet allowing the mouse to look up and down. Do I rotate his spine some how with script? I have searched all over and cant seem to find what to do. I would much appreciate any help and advise on this please.
In case you have not resolved this issue, or for anyone else that has a similar problem to you (or me)
Although I made my model in 3DS max, I expect this to work similarly for you. I attached an adaptation of the mouselook script to the 2nd of my 3 spine segments (it seemed to work best for the way the back bending looked). I changed it to JS from c# but it is pretty easy to convert. My solution was base on the fact that the update needs to be changed to a Late one and also the angle of rotation needs to be on the Z axis because of the orientation of the spine:
var sensitivityZ = 15F;
var minimumZ = -60F;
var maximumZ = 60F;
var rotationZ = 0F;
function LateUpdate ()
{
rotationZ += Input.GetAxis("Mouse Y") * sensitivityZ;
rotationZ = Mathf.Clamp (rotationZ, minimumZ, maximumZ);
transform.localEulerAngles = new Vector3(0, transform.localEulerAngles.y,rotationZ);
}
function Start ()
{
// Make the rigid body not change rotation
if (rigidbody)
rigidbody.freezeRotation = true;
}
To get the Z axis you need to edit Input.GetAxis (“Mouse Y” ); to Input.GetAxis(“Mouse X”);
unity .GetAxis runs off x & y not y & z, The link down below can help.