# Create a variable

> Instructions on how to create a variable for your Logic script.

Create variables to store data that your Logic script can use and modify. Remember to [assign any references](#assign-references) after creating variables.

To create a variable, use the following steps:

1. Open your Logic script.
2. Select the **Add** (**+**) icon next to **Variables**. The **New Variable** window appears.
3. Change the settings to your preferences.
4. Select **Create**.

## Assign references

To set variable values:

1. Select your GameObject that has your Logic attached. The **Inspector** panel shows.
2. In the **Inspector**, find your Logic.
3. Either set the variable value, or drag an object from the **Hierarchy** panel into the variable slot.

> **Tip:**
>
> Unity Studio highlights missing references in orange in the **Logic** component. Orange Bug notifications remain on the bug icon in the **Scene** view until you fix them.

## Additional resources

* [Introduction to Logic](/unity-studio/develop/logic/logic-intro.md)
* [The Logic Editor interface](/unity-studio/develop/logic/logic-interface.md)
* [Create a Logic script](/unity-studio/develop/logic/create-logic.md)
* [Methods and variables](/unity-studio/develop/logic/methods-variables.md)
* [Nodes](/unity-studio/develop/logic/nodes.md)
