# Data Types\Number\ Variable

---

### [![SET.png](https://simlab-soft.com/help/uploads/images/gallery/2024-08/set.png)](https://simlab-soft.com/help/uploads/images/gallery/2024-08/response-value-number-add.png) Set

Has two options:

[![Add_Node.jpg](https://simlab-soft.com/help/uploads/images/gallery/2024-08/scaled-1680-/Wp1image.png)](https://simlab-soft.com/help/uploads/images/gallery/2024-08/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](https://simlab-soft.com/help/uploads/images/gallery/2024-08/scaled-1680-/Bdhimage.png)](https://simlab-soft.com/help/uploads/images/gallery/2024-08/Bdhimage.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](https://simlab-soft.com/help/uploads/images/gallery/2024-08/scaled-1680-/6gRimage.png)](https://simlab-soft.com/help/uploads/images/gallery/2024-08/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](https://simlab-soft.com/help/uploads/images/gallery/2024-08/scaled-1680-/sGSimage.png)](https://simlab-soft.com/help/uploads/images/gallery/2024-08/Bdhimage.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](https://simlab-soft.com/help/uploads/images/gallery/2024-08/response-variable-numberdecrement.png)](https://simlab-soft.com/help/uploads/images/gallery/2024-08/response-value-number-add.png) Decrement Number Variable

  
[![Ceiling Node.png](https://simlab-soft.com/help/uploads/images/gallery/2024-08/scaled-1680-/UoLimage.png)](https://simlab-soft.com/help/uploads/images/gallery/2024-08/add-node.jpg)

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](https://simlab-soft.com/help/uploads/images/gallery/2024-08/scaled-1680-/bbzimage.png)](https://simlab-soft.com/help/uploads/images/gallery/2024-08/hUtimage.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_NumberIncrement.png](https://simlab-soft.com/help/uploads/images/gallery/2024-08/response-variable-numberincrement.png)](https://simlab-soft.com/help/uploads/images/gallery/2024-08/response-value-number-add.png)<span data-darkreader-inline-color="" style="color: rgb(34, 34, 34); font-size: 2.333em; font-weight: 400;"> Increment Number Variable</span>

  
[![Ceiling Node.png](https://simlab-soft.com/help/uploads/images/gallery/2024-08/scaled-1680-/0Eyimage.png)](https://simlab-soft.com/help/uploads/images/gallery/2024-08/add-node.jpg)

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

[![Increment.JPG](https://simlab-soft.com/help/uploads/images/gallery/2025-03/increment.JPG)](https://simlab-soft.com/help/uploads/images/gallery/2024-08/hUtimage.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_NumberGet.png](https://simlab-soft.com/help/uploads/images/gallery/2024-08/response-variable-numberget.png)](https://simlab-soft.com/help/uploads/images/gallery/2024-08/response-value-number-add.png)<span data-darkreader-inline-color="" style="color: rgb(34, 34, 34); font-size: 2.333em; font-weight: 400;"> Get </span>

[![Ceiling Node.png](https://simlab-soft.com/help/uploads/images/gallery/2024-08/scaled-1680-/FbIimage.png)](https://simlab-soft.com/help/uploads/images/gallery/2024-08/add-node.jpg)

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](https://simlab-soft.com/help/uploads/images/gallery/2024-08/scaled-1680-/o5himage.png)](https://simlab-soft.com/help/uploads/images/gallery/2024-08/o5himage.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.

---