🎉 Welcome to the Mirage Renderer Docs Beta.

Random Nodes
Draw Weighted

Draw Weighted

Creates an array based on DrawStructure drawing from DrawArray element with probabilities of Distribution.

Inputs

  1. DrawArray: Array to be drawn from (float[], int[], Vector2[], Vector2Int[], Vector3[], Vector3Int[], Vector4[])
  2. DrawStructure: Indicates how many elements should be drawn for each index (int[])
  3. Distribution (optional): Distribution probabilities between ranges (Curve). If not connected uniform distribution assumed.
  4. Sort (optional): true -> ascending, false -> descending, empty no sorting. (bool)
  5. RandomSeed (optional): Random number generator seed. If not connected, the node will use Graph’s random number generator (int)

Outputs:

  1. Out: Randomly selected (weighted) values from DrawArray (float[][], int[][], Vector2[][], Vector2Int[][], Vector3[][], Vector3Int[][], Vector4[][])

Example

Draw Weighted node example