Randomize selects a random output for continuing the flow, or it can randomize a set of boolean values.
The parameters are as follows.
Range: amount of selectable values/flow outputs
Random Count: how many values should be selected - must be less or equal than Range
Random Type: changes node behavior. Possible values for Random Type are:
- Flow: selected values will be flow outputs. This can be useful when you have some random things that may or may not happen.
- Bool: selected values will be bools. For example, this can be useful if you want to randomize visibility of the objects in the scene, and can use the booleans as the flags for setting that visibility.
- Both: both of the above. This will create a set of outputs, and a set of boolean out ports.
Behavior
In: when called, will immediately call Out output. Then, if it is the First Time this node was called, it will randomly select the Random Count amount of values and, based on the selected Random Type mode, will do the following:
- Flow: will call the selected flow outputs in random order (if more than 1 was requested)
- Bool: will set the selected boolean values, that can be used by the flow after that
- Both: will do both, with boolean selection happening first, and flow calls second
Any subsequent calls to In will repeat everything, except the random selection part.
Reset Randomization: will force the node to re-roll the randomization. Note that this will not invoke anything else. To call flow outputs, you should still call In after Reset Randomization.
Usage
As described, Random can be great for doing a number of things, such as:
- Performing random actions that may or may not happen, using randomized Flow outputs
- Randomize visibility of the objects in the scene, using randomized Boolean outputs
Here is another example that picks a random objects, makes it visible first, and then makes it selectable (clickable by user):
States
No states, this node is instant.
Notes
No notes here, yay đ