Topic was automatically imported from the old Question2Answer platform.
Asked By
KainAlive
I am switching from Unity to Godot and wanted to restart one of my Unity projects in Godot. This requires a “ping-pong” of the rotation value, so my player is rotating back and forth. In Unity I could use the Mathf.pingpong function. Is there any way to use something like this in Godot?
This will pingpong a value between zero and one, scaled by amplitude. The sine function returns a value between -1.0 and 1.0 which is then converted to the range 0.0 to 1.0