Skip to reading
Visual Scripting in Depth

16. Set, create or change a value

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView illustrations

Figure 12. Change Variable can add to a number, toggle a flag or set a live value from an expression.

Source table from 16. Set, create or change a value, page 20
NodeUse
Set VariableAssign one value. Set key_taken to Boolean true.
Create VariableAdd a runtime variable only if that name does not already exist. It does not reset an existing one.
Change Variable: setAssign a JSON-capable value, including a resolved expression.
Change Variable: add / subtractIncrease or decrease a numeric value.
multiply / divideNumeric arithmetic. A zero divisor leaves the existing value unchanged.
appendAppend one value to an array; it is not text concatenation.
toggleInvert the current truth value.

1. Add Change Variable. Choose pulse_count.

2. Choose add under Operation.

3. Enter 1 in Value, without quotation marks. Commit the field.

4. Call the graph, then inspect pulse_count. A second call should add one again.

The special Set Variable editor follows the declared variable’s type. For an expression such as {"$param":"amount"}, use the JSON-capable Change Variable node with operation set or add instead of pasting that object into a Boolean dropdown.

Page 20 of 93Permalink
Go to page