To fix this rotation you’re going to need you use a couple Quaternion.FromToRotation() calls and multiply them together (multiplying Quaternions is how you add them together). And the Order you multiply the quaternions matters.
so what you need to do is find the rotations needed to get from a normal forward z, right x, and up y (z,x,y) to get the orientaion you have on that spine, forward -y, right z, up -x (-y,z,-x).
from (z,x,y) → (-y,z,-x). this can be achieved in two 90 degree rotations.
(z,x,y) → (z,y,-x): rotate along the z axis CW making y right and -x up
(z,y,-x) → (-y,z,-x): rotate along the x axis CCW making -y foward and z right
so there’s a simple pattern happening here (which is a known rule in Quaternion and Complex number math). when you rotate 90 degrees about an axis the other two terms swap places after one of those terms is multiplied by -1. when rotating clockwise the first term is multiplied by -1 before swapping. while rotating counter clockwise the second term is multiplied by -1 before swapping. This is why the order matters when you multiply quaternions together.
so the first rotation declares that my Up is now at my Right
the second rotation declares that my Right is now at my Back
thus the code used to get the same correction should be this
Quaternion correction;
void Awake()
{
//unity will figure out the axis its rotating around (i.e transform.forward) and
// the angle it rotates about (90 degrees) and save that rotation
correction = Quaternion.FromToRotation(Vector3.Up,Vector3.Right);
//we now find the other rotation and multiply them together (which in Quaternion terms is adding the rotations)
correction = correction * Quaternion.FromToRotation(Vector3.Right,Vector3.Back);
}
now you can simply use the LookRotation like before but then multipliy in the correction rotation
Quaternion lookRotation = Quaternion.LookRotation(target - torso.transform.position) * correction;
If your curious behind the concept of Quarternions, Numberphile has a nice video that conveys Quaternions in a simple manner plus a little bit of its history