Function:
- Changes the value of an existing Value Node to a new value of the same type.
Can be connected to:
- Nodes with Flow inputs (Behavior, Action, Flow Controls, Events and Triggers).
- Value Nodes (Boolean, Integer, Float, Vector, etc.).
Particularities:
- This Node cannot be used on its own. It must be part of a chain containing a triggering Node, such as an Event Node, Trigger Node, or On Start Canvas.
- The Old Value and New Value inputs must use the same data type (Boolean to Boolean, Integer to Integer, Vector to Vector, etc.).
- The Old Value input identifies the value to modify, while the New Value input determines the value that will replace it.
Using the Set Value Node
Example: Changing a Boolean value from False to True.
In order to recreate this scenario, you'll need to place the following asset in your Space:
- A Canvas
- An Asset
Setting up the scenario:
- Add an On Start Canvas Node.
- Add a Set Value Node.
- Add two Boolean Value Nodes.
- Set the first Boolean Value Node to False.
- Set the second Boolean Value Node to True.
- Connect the Flow Out of the On Start Canvas Node to the Flow In of the Set Value Node.
- Connect the first Boolean Value Node to the Old Value input of the Set Value Node.
- Connect the second Boolean Value Node to the New Value input of the Set Value Node.
Testing the scenario:
Enter Play Mode to execute the scenario.
When the Canvas starts, the Set Value Node changes the first Boolean value from False to True.
Any nodes referencing that Boolean value will then use its updated value.