Skip to main content

MathUtils.randomRange

Function

Generate a random floating-point value in the range [lo, hi).

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

randomRange(lo, hi): number

Generate a random floating-point value in the range [lo, hi). Note, the range is inclusive at the lower end, and exclusive at the upper.

Parameters

ParameterType
lonumber
hinumber

Returns

number