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_NumberIncrement.png Increment Number Variable


Ceiling Node.png

The Increment Number Variable response enables the user to increase a variable's value by 1 each time the event connected to it is triggered. Once the response is executed, the updated value can be acquired through the Value port.

Example

image.png

In this example, a Increment Number Variable response is used to increase 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.

 


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 event connected to it is triggered. 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.

 


Response_Variable_NumberGet.png Number Variable Value


Ceiling Node.png

The Number Variable Value response enables the user to get a variable's value each time the event connected to it is triggered. Once the response is executed, the updated value can be acquired through the Value port.

Example

image.png

In this example, a Number Variable Value response is used to get the new value for Variable1 after it was changed by Set Number Variable By Expression once the user triggers the object named GetValueButton. The value of the number variable is then written in a variable named Result, which can then be connected to a variable writer to be displayed during the VR experience.