What it does
math.clamp takes v, min and max.
Signature
math.clamp(v, min, max)Arguments
vminmax
Example · generated
function update(dt) { math.clamp(0.5, 0, 1);}math.clamp 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.