Set Variable Action
Set Variable Action can update the value of a variable defined by an expression. The expression can reference another variable or variable helpers.
Learn more about
How to use Set Variable Action
When an Event is performed, a variable can be set to a new value in the Set Variable Action by an expression – it can be either updated to another variable or a custom calculation. Following Events have access to Set Variable Action.
Learn how to use Set Variable Action through how-to steps in the
Events supporting Set Variable Action
When an Event is performed, a variable can be set to a new value in the Set Variable Action by an expression – it can be either updated to another variable or a custom calculation. Following Events have access to Set Variable Action
Set Variable Action properties
Select Variable
Select the variable to be updated via the Set Variable Action. The dropdown list will access any variables that are available on the current file.
Add Expression
Create an expression to which the selected variable should be updated.
The following variable types can be used:
Variable type | Defined by | Usage |
---|---|---|
🤹 Variables | Number, String, Boolean, Timers, Counter or Random | Variables can store values that are reusable. For detailed explanation read the Variables doc. |
ℹ️ Object Property | Object’s position, rotation, or scale (X, Y, Z), or it’s width, height and depth as a number, e.g.: | Capture object property changes, and save them as variables to create advanced interactions. |
🖱️ Mouse Position (2D) | The position of the mouse on the screen is defined by X and Y as numbers. | Animate or manipulate objects based on the mouse position |
💥 Mouse Hit Position (3D) | The position of the mouse hitting an object in 3D space, as Position X, Y, or Z of the hit location, or the Position X, Y, and Z of the object that was hit. | Create interactions based on specific hit positions, e.g.: visualize hit in 3D space. |
The following math operations can be used in formulas:
Symbol | Operator |
---|---|
| Add |
| Subtract |
| Multiply |
| Divide |
| Random value |
| Group calculations with parenthesis |
Some example formulas to spark ideas
Variable A + Variable B
Variable A * 10 / 2
(Variable A + Variable B) * 10