vScriptValRandom
Generate an array of random values between a low and a high limit, packed as X, X Y or X Y Z entries.

vScriptValRandom has no input and outputs an array of random entries. Array length sets the number of entries, Pack To sets how many values each entry holds, and the Low and High range sets the limits.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Array length | Integer | 2 | Number of entries in the output. Minimum 2, default 2. |
| Low | Float | -1 | Lower end of the range the values are drawn from. Default -1. |
| High | Float | 1 | Upper end of the range the values are drawn from. Default 1. |
| Multiply | Float | 0 | Hidden control. It is read by the node but has no effect on the output. Default 0. |
| Seed | Integer | 0 | Seed of the random generator. Default 0. |
+1 more parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| Pack To: | Dropdown | X Y Z | Number of values in each entry, X, X Y or X Y Z. Default X Y Z. |
Read the full description
The node seeds Lua's random generator with Seed and writes Array length entries. Every value is drawn from a uniform distribution between Low and High. The same Seed gives the same output.
Pack To selects the entry size: X gives one value per entry, X Y gives two and X Y Z gives three. The same Low and High apply to every value in an entry. With the defaults (Array length 2, Low -1, High 1, X Y Z) the node outputs two entries of three values each, so it can be used directly as XYZ points.
Array length has a minimum of 2. Seed is a whole number from a slider with a displayed range of -100 to 100 and no limit in the code. Use vScriptValMinMax if each value needs its own range.
Example Connections
- Draw random points
- Offset the points before drawing
vScriptValRandom.Output -> vScriptValCameraProjection.ArrayA
vScriptValCameraProjection.Output -> vScriptValShapeRender.ArrayPoint
Background.Output -> vScriptValShapeRender.Input
vScriptValRandom.Output -> vScriptValTranslate.ArrayA
vScriptValTranslate.Output -> vScriptValCameraProjection.ArrayA