Store camera rotation

I’m trying to get the value of the camera’s rotation through transform.rotation.x, but the value of the X position is displayed.

The transform.eulerAngle.x displays the value of the rotation X, but only when it is positive, when the rotation X is negative, the value in degrees is displayed.

Can someone help me because this is happening? and a way to solve Thank you.

Good day.

I’m not sure what are you asking, but as you say, this:

float xCamRot = transform.eulerAngle.x;

will store the x rotation of the camera to the variable. What is the problem?

Think that -10º is the same as 350º

Bye!

@JvJanus You can find the angle by subtracting from 360;
for example:

   xAngle=transform.eulerAngles.x
  angle=xAngle;

      if(angle>180)
        {
        angle=angle-360
        }

will give you angle in negative.
hope it helps