The truncate function returns the truncated value of the argument. This means that the function cuts off all floating point values of the argument and returns an iteger instead. All floating point values will be cut off regardless of their value - e.g. the argument 2.9 will be truncated and the function will return 2.
sphere.YPosition = trunc( sin( time * 90 ) * 2 );
This will cutoff all floating point values of the wave and return stairsteps.
|