Equivalent function of Frac(x) in Godot

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

Hye everyone,
Would you know what the equivalent in godot is of this:

Good day,

:bust_in_silhouette: Reply From: haydenv

The equivalent is x - floor(x).

Another equivalent is fposmod(x, 1.0).

Both of the above also work if x = 0 or x < 0.

Source: GDScript built-in functions

Good day to you too.

Thank you, It helped me a lot

patatra | 2022-05-14 08:37