What's up with these angles?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By keke
:warning: Old Version Published before Godot 3 was released.

What’s with the angles given/set by get_rot() and set_rot()? I don’t understand what they are “in” - it seems like radians, but then you get these negative numbers…?

They are in radians. What values are you seeing? Negative values just mean rotations in the opposite direction, i.e. PI/2 versus -PI/2.

Note that if you want to use degrees you can use get_rotd() and set_rotd().

kidscancode | 2017-02-19 20:07

How strange - I expected get_rot() to always return a number from 0 to 2PI, but it just stays however you set it! So if I set_rot(3PI), get_rot()returns 3PI, not PI.

keke | 2017-02-19 21:23

(Make your comment into an answer and I’ll accept it.)

keke | 2017-02-19 21:24

:bust_in_silhouette: Reply From: kidscancode

The angles are in radians. Negative values just mean rotations in the opposite direction, i.e. PI/2 versus -PI/2.

Note that if you want to use degrees you can use get_rotd() and set_rotd().

This should be documented. There’s no documentation on get_rotd at all in the stable doc.

SasQ | 2017-12-09 20:13