PLEASE IM DESPERATE How to get object's 360 rotation

Godot Version

godot 4

Question

how would i get object rotation? i can already do this by myNode.rotation.x but it gives me stuff like this
image
and i turn around a bit and it never reaches close to 360. is there a way to convert this to 360 degrees of rotation? or is there a way to access the node’s 360 degree rotation?

Just guessing from the numbers you’re getting, Godot might be working in radians, and not angles.

I don’t know a lot about 3D, so I can’t help you further, but I did find this article about 3d transforms and euler angles (angles in 3 dimensions). Using 3D transforms — Godot Engine (stable) documentation in English

I can’t say too much about if that will help you with your problem, but hopefully that article will help some (and suspecting that the rotation is in radians - you can look to see if Godot can covert between angles and radians, or possibly even write your own function for it.)

1 Like

Maybe try this? It also works with Vector2
Vector3 rotation_degrees

  • void set_rotation_degrees ( Vector3 value )
  • Vector3 get_rotation_degrees ( )

Helper property to access rotation in degrees instead of radians.

1 Like

well, this is embarrasing, i was checking the wronge axis so when i turned the camera around, i jittered the mouse up and down a bit and that gave me a seemingly random number. lol

Nice! Glad you got it!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.