This node requires the user to select object(s) by point-and-click, and then reports on what was selected.
This node is one the of Selection node family. Nodes in this family share the functionality.
Flow Configuration
When In is called, objects become selectable and the node begins to track the selections. Out is called instantly.
When all of the required objects are selected (configured by Selection Amount), All Or Max Tries is called. This will cause the node to stop automatically.
Any is called for each selection
If Unique Flows For Each Object is checked:
Any Not Connected: called for any object that does not have a unique output connected to anything
List of Unique Outs: generated for every option. If it isnāt the same as selectable options, click Refresh. These get called when their specific object was selected. Note: since every object can only be selected once, this will only be called once also
Last Selected: returns the last object that was selected. Useful for Any or Unique Options
Break: calling this will instantly stop the selection, will not call anything after that
Node Configuration
Selection Amount: defines how many objects should be selected:
- All Enabled: will wait until all of the enabled objects are selected. The node does not change the state of the scene in any way. That means that you will have to enable/disable objects beforehand. For example if you have 5 different objects and you disable 2 of them before calling this node, the user will need to click only on 3 objects that are left before All Or Max Tries is called.
- Limited: will limit the amount of ātriesā to select the correct options to specified amount. For example if you have same 5 objects, disable 2 of them, and then limit the selection to 2, user will be able to select only 2 objects of the 3 available, before All Or Max Tries is called. This can be used not only for correct/incorrect scenarios, but also in āselect 2 of this 5 items to add to the cartā
Selection Mode: changes the type and amount of objects that can be selected:
- Single Object: makes only 1 object available for selection. Object can be set directly or pulled from flow. Canāt specify Selection Amount or Unique Outs
- Static List: creates a list of selectable object inside of node. Can use Selection Amount and Unique Flows For Each Object parameter. However, the selectable list of selectable objects cannot be changed in runtime.
- Dynamic List: creates a value input for list of objects. Can use Selection Amount parameter. This is useful if you need to modify the list in runtime or you have several nodes that access the same list of options. However, since the list size and insides are unknown, it is impossible to use Unique Outs. You will have to make do with Any + Last Selected combo to look up what was actually selected
- Variable List: creates a list of value inputs for objects value input for list of objects. Needs Variables Count to specify amount of inputs. Can use Selection Amount and Unique Flows For Each Object parameter. Due to the nature of variables, it is impossible to get the name of the option ahead of the time, so unique outs will be instead called by their id
Usages
This is a go-to node for any point-and-click 3D objects selection. Use it if you need the user to select anything on the scene. Available objects will automatically get outline on pointer hover. While any selection node is active, userās hand will automatically enter pointer state and pointing laser rays will be shown from index fingers.
States
Busy when there are objects that can be selected.
Error if you start any other selection. Only one selection can be active at the same time.
Notes
Note that for selection to work, you need GameObjects with colliders on them, since pointing and object detection is done on colliders. By the way, you can have a complex object, where you select parent object as the selectable one, while you have a bunch of colliders in its children.