Rounding up numbers
-
Hi everyone, is there a way to check if a value is not a whole number and if so to round up?
I basically have a strange issue with Dizzy’s Y position returning -0.44 when jumping up a step underwater facing forwards, but not when facing sideways - odd, and barely noticeable but it bugs me!
-
Is this helpful? https://fuzearena.com/help/view/round
-
That will round up or down to the nearest whole number. Do you always want to round up?
-
Ceil() rounds up!
-
To check if it is a whole number you can compare the original number with the rounded value. If they are the same, then the number was whole to start with.
-
dizzy.y = ceil (dizzy.y)
So simple! Thanks a lot everyone 😄
And yes pianofire - for now I just need it rounded up. It’s all useful knowledge anyway!