Skip to main content

Data Types \ Number \ Variable

SET.png Set

Has two options:


Add_Node.jpg

  • By Value:

The Set number variable response enables user to set a value by either typing in a numerical value in the value field or by attaching a value or a variable node to that port. Then once the response is executed, the variable value can be acquired through the Value port.

Example

image.png

In this example, a Set number variable is used to assign the value of Variable1 once the user triggers the object named Activate, and the new value is then written in a variable named Result, which can then be connected to a variable writer to be displayed during the VR Experience.


Add_Node.jpg

  • By Expression


The Set number variable by expression response enables user to set a value by either typing in an expression in the expression field or by attaching a value or a variable node to that port. Then once the response is executed, the variable value can be acquired through the Value port.


Example

image.png

In this example, a Set Number Variable By Expression is used to set the result of the sum of Variable1 and Variable2 once the user triggers the object named Activate. The new value is then written in the Result variable, which can be connected to a variable writer to be displayed during the VR experience.

 


Response_Variable_NumberDecrement.png Decrement Number Variable



Ceiling Node.png

The Decrement Number Variable response enables the user to decrease a variable's value by 1 each time the object named Activate is triggered. This can be done by either typing in a numerical value in the variable field or by attaching a value or a variable node to that port. Once the response is executed, the updated value can be acquired through the Value port.

Example

image.png

In this example, a Decrement Number Variable response is used to decrease the value of Variable1 by 1 once the user triggers the object named Activate. The result of the decrease number variable operation is then written in a variable named Result, which can then be connected to a variable writer to be displayed during the VR experience.