So this might be a long one, I am trying to assimilate all the information about rotations in Unity.

Euler angles: What I know is that euler angles are a way of representing the rotation of an object with respect to its parent or the world axes. The two problems with them are, there are multiple euler angles for any rotation, and they suffer from gimbal locks.---------------------------------------------------

The first problem, I think I understand, but please add or correct whatever you need to: So unity applies rotations in the ZXY order according to its docs, so the euler angle values are usually according to this order. But since it is not the only order of getting to the required orientation, other orders can be applied too. Hence the lack of uniqueness of a euler triplet. This makes any situation where we need to read their values to progress dangerous. But any situations where they only need to be incremented or decremented from, may be fine…unless we run into the second problem which is gimbal locks.--------------------------------------------------------------------------------------------------------------

Here is my limited understanding of gimbal locks: Gimbal locks occur when a degree of freedom is lost due to certain rotations. What I dont understand is why are rotations treated as gimbals? Why must there be a hierarchy of axes to decide rotation order, with Z affecting X and Y, X affecting Y and Y not affecting the other two. The rotation gizmos in unity dont act like gimbals and a rotation around one of the axis changes the orientation of the other two axes accordingly for all three axes, thus always keeping the axes mutually perpendicular. So why is it that a gimbal lock situation must ever arise? -----------------------------------------------------------------------------------------------------------------------------

Finally, I went on this journey hoping to understand rotations better because of a problem Im facing in my project. I am trying to make a ghost playable character, that has 3 dimensional motion similar to the free roam cameras in games like counter strike where after you die you can explore the entire map using the free roam camera.---------------------------------------------------------------------------------------------

Mouse movement in the vertical and horizontal axes should make the ghost look in that direction so the z axis of the ghost should face in the direction I am looking, and then with the arrow keys if i press forward, the ghost moves along that new z direction and similarly the new x and y directions using the different keys I have assigned. Now the problem is when I wrote a look script for the ghost, I rotate the ghost around its x and y axes based on Mouse Y and Mouse X input. Then I change the ghosts direction using the quaternion multiplication operator such that ghost.rotation *= Quaternion.Euler(xRot,yRot,0) . ------------------------------------------------------------------------------------------------

But the issue is this causes the ghost to also tilt along its z axis which I do not want. I found the parenting solution where the parent is used for horizontal looking and the ghost is its child and looks in vertical. But I wanted to understand why this issue arises, hence the whole journey which has brought only more questions so far. -----------------------------------------------------------------------------------------------------------------------

If someone took the time to clarify these things for me, I would be really really grateful!