//auto stabilise rotation, except for the mainParent.transform.rotation.y (because this is the right/left movement)
float rotx = mainParent.transform.eulerAngles.x - transform.eulerAngles.x;
float rotz = mainParent.transform.eulerAngles.z - transform.eulerAngles.z;
Quaternion.Lerp(transform.rotation, Quaternion.Euler(rotx, 0, rotz), 0.99f);
↧