Topic was automatically imported from the old Question2Answer platform.
Asked By
lalel345
I know how to get the length of a vector 2 but there is something similar for rotation.
velocity = Vector2()
velocity.length()
Not sure I follow. What do you consider the length of a rotation? Maybe the length of the arc segment between rotationA and rotationB at some (yet-to-be-specified) distance?
jgodfrey | 2020-12-02 20:52
If you mean how to get the rotation from a Node2D, just use its rotation property as follows:
Both jgodfrey and _magicalogic_ are right: You can’t get a “length of rotation” without specifying a radius. You can either get the angle with $My_Node.rotation (like _magicalogic_ said), or get the length of the arc segment at a specific radius, like jgodfrey said. For the latter, there’s no inbuilt function (as far as I’m aware), but you can easily create one yourself: