0 votes

Hi!

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.

in Engine by (106 points)

1 Answer

+1 vote
Best answer

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. https://docs.godotengine.org/en/stable/classes/class_@gdscript.html?highlight=wrapf#class-gdscript-method-wrapf

by (189 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.