Documentation

​
​

Development

User Acquisition

Monetization

Industry

Unity Studio

Open Unity Studio

Unity Studio

​
​
Unity Studio
  • What's new in Unity Studio
  • Introduction to Unity Studio
  • Launch Unity Studio
  • Create your first Unity Studio project
  • Develop with Unity Studio
    • The Unity Studio interface
    • Save your progress
    • GameObjects
    • Assets
    • Materials
    • Scene settings
    • Logic
      • Introduction to Logic
      • Create a Logic script
      • The Logic Editor interface
      • Methods, variables, and parameters
        • Introduction to variables, methods and parameters
        • Create a variable
        • New Variable window reference
        • Create a method
        • New Method window UI reference
      • Nodes
      • Logic examples
    • The UI Creator
    • Animation
    • AI features
  • Collaborate in Unity Studio
  • Export drafts to the Unity Editor
  • Publish and share
  • Troubleshooting Unity Studio issues
  • Report bugs and share feedback
  • Manage your analytics and marketing preferences
  1. Unity Studio
  2. Develop with Unity Studio
  3. Logic
  4. Methods, variables and parameters

New Variable window reference

A detailed description of each of the properties of the New Variable window.
Read time 1 minute
Last updated 6 months ago

Use the New Variable window to set up a new variable to use with your Logic script.

Property

Description

ScopeDecide how visible your variable is to other methods in your Logic:
  • Local: Only available inside a single method. Disappears when the method finishes.
  • Global: Available throughout your Logic script as long as the GameObject exists. Default.
Unique NameGive your variable a name that's easy to identify. Use descriptive names (for example,
Door_Anim
for a door's animation). Make sure the name doesn't contain spaces.
TypeChoose what kind of data your variable holds. For example, numbers, words, an object etc.
Default valueSet the initial value of your variable. This property only shows when you set Type to Bool, Float, Int, String, Vector3, or Vector2.

Type dropdown

The Type dropdown in the New Variable window includes the following options:

Option

Description

ObjectReference to a GameObject in your scene
BoolTrue/False (on/off)
FloatDecimal number
IntWhole number
StringText
Vector3/Vector2Position or direction in 3D/2D space
ColorColor value
TransformPosition, rotation, and scale info
ColliderBox, Capsule, Sphere, Mesh Collider
RigidbodyPhysics properties
Camera, Light, Material, UI Transform, Canvas, Button, Text, InputField, Animation, Image, Quaternion, Logic(Specialized references for UI and scene elements)

Additional resources

  • Create a variable
  • Create a method
  • New Method window UI reference

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.

  • On this page
    • Type dropdown

    • Additional resources


Report a problem with this page