clamp()
On this page
clamp(value, minimum, maximum)Keep a numeric value inside a limit.
Returns: Number between the supplied limits.
clamp(120, 0, 100)lerp()#
lerp(start, finish, weight)Interpolate two numbers. A weight of 0 chooses start; 1 chooses finish.
Returns: Number.
lerp(10, 20, 0.25)The helper is numeric, not a vector or color interpolation API. Clamp weight yourself if extrapolation is unwanted.
distance()#
distance(a, b)Measure two Vector2 values, two Vector3 values, or the absolute difference of two numbers.
Returns: Number; 0 for unsupported pairs.
distance(vector3(0, 0, 0), vector3(3, 0, 4))Do not pass character references and expect positions to be discovered automatically.
random_int() and aliases#
random_int(minimum, maximum)Choose a whole number, including both endpoints.
Returns: Integer.
Aliases: random_integer()
random_int(1, 6)