The floor function rounds always down the argument. This means that the function returns always the next lower integer value for any given argument with a negative or positive floating point value - e.g. the argument 2.9 will be rounded down and the function will return 2. If the argument is -2.1 the function will return -3 because it is the next integer with a lower value than -2.1.
sphere.YPosition = floor( sin( time * 90 ) * 2 );
This will round down all floating point values of the wave and return stairsteps:
|