I have this scrip attached to camera and when the camera goes below 60 X rotation the y and z change to 180 and changes to some random angle which i didn’t set why is this happening?
Rotations are stored as quaternions, and there’s more than one valid way of converting quaternions to euler angles (e.g., 0, 0, 0 is the same as 180, 180, 180). The rotations aren’t messing up, they’re correct. Reading only one axis of euler angles is not advisable, because out of context with the other two it’s not very meaningful.
I’m getting this error: error CS1612: Cannot modify a value type return value of `UnityEngine.Transform.localRotation’. Consider storing the value in a temporary variable
I’m not that good with rotations so i don’t know how to handle this.