Hello Devs! I have problem with checking if my negative x rotation is less than -25f..I want to stop rotation at -25f if the rotation is less than -25f, but this if statement dont even print something in the console if rotation is less than -25f.. This is my code, and i have the exactly same code right below, except values is positive and that code work perfect, but this code with just negative values dont work, i really dont know why?
myBody.velocity = new Vector3(0f, 0f, -smoothForceZ);
transform.Rotate(new Vector3(-100f * (Time.deltaTime * rotationSpeed), 0f, 0f));
float rotationNX = transform.eulerAngles.x;
if (rotationNX < -25f)
transform.rotation = Quaternion.Euler(new Vector3(-25f, 0f, 0f));