What it does
math.random takes min and max. min and max are optional.
Signature
math.random(min?, max?)Arguments
minoptionalmaxoptional
Example · generated
function update(dt) { math.random(0, 1);}math.random is called with values of the shape its signature asks for. The code sits in update(dt), which the engine calls every frame: dt is the time since the last one, in seconds.