I need to get game object x rotation to verible .I did but it giving me 0.03579392 like float how I get that like 90,34,78 like that
Rotations in 3D space are more complicated than it seems in the editor. Programmatically, transform.rotation
is a quaternion, which has x, y, z, and w values from 0 to 1, which allows rotations to function more effectively without issues. What you’re looking for is Euler rotations. The property for that is transform.eulerAngles
, and then .x
etc will return values in angles. E.g. myObject.transform.eulerAngles.x
.
I hope this was helpful