The Selector stores e.g. a set of sounds, animations or values, and passes one of them forward based on the input. It's a powerful node for many purposes, such as assigning different looks for player characters, managing a bunch of texts, or randomizing objects to be spawned.
You can edit the stored elements and their type, as well as the selection mode.
Edit | Tap this to edit the data type of the stored elements, the amount of possible cases, as well as how each case is selected (Selector mode). See below for details |
Execute | Executes the node |
↳ On Start | Executes the node as soon as the game loads |
Enabled | Enables or disables the node. Disabled nodes cannot be executed |
Seed | Sets a seed for random number generation *Seed is only visible if the Selector mode is set to Probability Distribution |
Value | Determines which of the stored elements is passed on from the output *Value input is needed if you're using the Number or Number Range Selector mode |
Case / Weight inputs | These are slots for storing elements in the Selector node. Set the elements manually or with other nodes. Edit the node to define the data type, to add or delete slots and to define how cases are selected |
New Weight Index | If you want to change the weight during game play, define with this value which weight will be modified. 0 = the first weight Only visible in Probability Distribution mode |
New Weight | Sets a new value to the weight defined by the New Weight Index Only visible in Probability Distribution mode |
Invalid Value | If the input doesn't match any of the Cases, the Selector will send this value from the output |
Output | Sends one of the stored elements to other nodes or objects |
Mode | Number selector | In this mode the Selector uses whole numbers as the input. The node will select the case that is equal to the input value. Example: The Selector receives the value 2 from a Number node. The element stored in Case 2 will be sent from the Output |
Number range selector | Each case is defined with a value range. The Selector checks whether the input matches one of these ranges and chooses the equivalent case. Example: The Selector has Cases 2.0 and 5.0. Case 2.0 will be chosen if the input is between 0.0-2.0. Case 5.0 will be chosen if the input is between 2.0-5.0. |
|
Probability distribution | No input values are required from other nodes. The selector randomly chooses one of the cases. For each case, you specify a weight, which determines how likely that case is to be selected. Example: The Selector has three cases with weights: 1, 1, and 2. The first two cases are equally likely, while the last case is twice as likely to be chosen. This results in probabilities of 25%, 25%, and 50%, adding up to 100%. |
|
Data Type | Select what type of data is stored in the Selector node (e.g. animation, number, text, object, music, material...) | |
+ Add Case | Adds a new case. Each case represents a slot used to store elements, along with the associated input or weight that determines when the case will be selected |
|
↳ Edit Case | Tap a value of a Case to edit it | |
↳ Delete Case | Tap the trash can icon next to a Case to delete it | |
✔ Confirm | Tap Confirm to exit the Selector editor |