How to prevent the rotation from going up infinitely?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nitsuga


My problem is that when I rotate a node it goes over 360 degrees and continues like this infinitely. I really don’t know if there is a problem with this but I would like to prevent that from happening.

I have tried using % to do it with integers but I don’t know how to do it with floats.

:bust_in_silhouette: Reply From: Andrew Wilkes

I don’t think that there is a problem but if you like, you can use the wrapf function to wrap the values around limits. @GDScript — Godot Engine (stable) documentation in English