ReferenceScript nodesMath › Random
Random Number in Range
A new random number each time it's read, Min and Max; Whole Number gives whole numbers, to included.
ƒRandom Number in Range
Min0Result
Max1
Whole Number
Inputs
| Pin | Type | Starts at | Notes |
|---|---|---|---|
Minfrom | number | 0 | – |
Maxto | number | 1 | – |
Whole Numberwhole | bool | false | – |
Outputs
| Pin | Type |
|---|---|
Resultout | number |
The code it becomes
The graph below written as a script would write it.
// On Scene Startscene.log(((false ? Math.floor(0 + Math.random() * (1 - 0 + 1)) : 0 + Math.random() * (1 - 0))));In a graph
◆On Scene Start
ƒRandom Number in Range
Min0Result
Max1
Whole Number
ƒPrint
In Text
The node with what starts it and Print to show what it gives, as Studio draws them.
Related
Notes from the community
Written by creators and checked by the docs' editors. Not part of Motion's official reference.