# Variable management

{% hint style="info" %}
**Good to know:** Variable management is the same for layer and global variables alike.
{% endhint %}

## Create Variable

You can create a variable by clicking on the **+** icon of the *Custom* variable group. Once you choose what information you would like your variable to hold by clicking on the correct menu entry, the variable will appear under the *Custom* variable group.

<div align="left"><figure><img src="https://3312042618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9sVaJpWJhPbmscipukhh%2Fuploads%2Fgit-blob-6ec864c82e249739466b441992accbc8a0218f27%2FCreateVariable.gif?alt=media" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
**Good to know**: You can also create different variable groups by clicking on the **Add group** button at the bottom of the *Layer variables* or *Global variables* collapsible.
{% endhint %}

## Rearrange Variables

You can change the order of a variable within its Variable group by clicking on its icon and **dragging** it to the spot you want to place it.

<div align="left"><figure><img src="https://3312042618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9sVaJpWJhPbmscipukhh%2Fuploads%2Fgit-blob-5b4a22f5a98d011036138517c9f22d1d7a794fb1%2FDragVariable.gif?alt=media" alt=""><figcaption></figcaption></figure></div>

You can also move a variable to another Variable group by **dragging** from its icon to the collapsible icon of the wanted *Variable* group.

<div align="left"><figure><img src="https://3312042618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9sVaJpWJhPbmscipukhh%2Fuploads%2Fgit-blob-44405c5f8de8d7be652aa50a6c4f7444e4fd00b8%2FDragVariableToGroup.gif?alt=media" alt=""><figcaption></figcaption></figure></div>

## Delete Variable

You can delete a Variable by clicking on its **Trash icon** or by right-clicking on the **Variable icon** and selecting **Delete**.

<div align="left"><figure><img src="https://3312042618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9sVaJpWJhPbmscipukhh%2Fuploads%2Fgit-blob-cd4a60563301b93c75cd285a627e8ddd2c6c5447%2FDeleteVariable.gif?alt=media" alt=""><figcaption></figcaption></figure></div>

## Adjusting Numeric Variables

Every numeric Variable has a setting to limit the minimum and maximum values. You can change it by left-clicking on the property and selecting **Min and max** setting. Similarly, the **drag rate** can be adjusted by left-clicking on the dropdown menu.

<div align="left"><figure><img src="https://3312042618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9sVaJpWJhPbmscipukhh%2Fuploads%2Fgit-blob-db1a374785dc957f89ca42ff01e1f8b37c6d71a5%2F240326-MINMAX.png?alt=media" alt=""><figcaption></figcaption></figure></div>

With some variables, you can toggle between appearances. You can do that by right-clicking on the Variable icon and selecting the appearance dropdown menu. You can change the Integer Variable to show *As Integer* or *As Dropdown*. This is useful for uniquely naming each integer. Likewise, Float Variables that are used for time and duration, have a similar dropdown menu and can appear *As Time* or *As Float.*

## Using Variables in Layouts

Drag a Variable on the layout either by dragging and holding shift or ctrl which skips the popup menu, or by dragging and dropping, which brings up a menu where you can select either a **Getter** or a **Setter** node.

<div align="left"><img src="https://3312042618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9sVaJpWJhPbmscipukhh%2Fuploads%2Fgit-blob-a3392b35725668fab844a3f521a8c3465ac9007f%2FSetterGetter.png?alt=media" alt=""></div>

### Getter and Setter Nodes

<div align="left"><img src="https://3312042618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9sVaJpWJhPbmscipukhh%2Fuploads%2Fgit-blob-ab35b21aca118ea5a79c9ad4bf31e75c0a4390af%2Fimage.png?alt=media" alt=""></div>

* **Getter** node is used to **get** the current value of a variable
* **Setter** node is used to **set** the current value of a variable

## Reference Node Replacement

In LightAct, you have the option to substitute the Getter or Setter node of a specific variable with the Getter or Setter node of another variable.

To do this, drag from the **Variable icon** of the desired variable to the *Reference node* you want to substitute.

<div align="left"><figure><img src="https://3312042618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9sVaJpWJhPbmscipukhh%2Fuploads%2Fgit-blob-13061c3ec624e3045a9eb1ae5bcdc51dd3736624%2FReplaceNode.gif?alt=media" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
**Good to know:** This can be extremely useful when you copy Reference nodes of Layer variables to other layers in the project.
{% endhint %}
