Variables
Variables are containers for storing data.
Add Variable
To add a variable, make sure the left panel is visible, then click the +
button in the upper right corner of the variable panel:
Variable Name
Unlike other programming languages, the variable name can be anything, including spaces. However, the variable name must be unique. You can click on the auto generated name or hit F2 to edit the variable name.
Variable Type
The type of variable is the same as described in Data Types except that for Arrays
, we break them down into specific types like Number Array
, String Array
, etc.
Initial Value
On the left panel, select any variable, and make sure the right panel is visible, you can edit the initial value there:
Use Variable
Drag the variable from the left panel to the canvas, upon dropping, there will a dialog showing up, choose either Get
or Set
:
Shortcut (Windows Only)
Upon dropping, if you hold CTRL
key, an Get Variable
node will be created, if you hold ALT
key, an Set Variable
node will be created. In either case, no dialog will show up.
Get Variable
Set Variable
TIP
For Set Variable
node:
- The left handle accepts value from other node
- The right handle returns the variable with new value