Skip to main content
Don't repeat tags in the title. If you care about one specific axis, say so.
Link
DMGregory
  • 140.8k
  • 23
  • 257
  • 401

Unity get Get object rotation around the x axis

Source Link
theCodeHermit
  • 59
  • 1
  • 2
  • 12

Unity get object rotation

I have an object which can be rotated at 0, 90, 180, 270 degrees. I am using this to get the rotation data:

transform.eulerAngles.x

However that code keeps ignoring 180 degrees and instead shows 0 or some weird calculation which is basically zero (smth like -93+2323232-4)

I have read about quaternions, eulers and unity rotations in general and every time I curse my life when I have to work with unity rotations...

Is there any human readable and efficient/easy way to get the exact rotation the object has ? Or at least to get these values from 0 to 360.