Construct 2 Basics - Variables



2,958 visits, 4,135 views



This tutorial hasn't been translated.


This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.



Variables are broken into two main categories in Construct 2: global variables and instance variables.

The main difference between these two types of variables is their scope. A global variable can be seen throughout your entire project, whereas an instance variable can only be seen within an object. This means that you can only refer to an instance variable when referring to a specific object, however a global variable is capable of being referred to on its own.

Another key difference is the creation destruction of these variables. An instance variable is created when an object is created, and is destroyed once that respective object has been destroyed. A global variable, however is created once your project/program is running, and is destroyed once it stops running.

These essential differences make it important to know when to use certain types of variables.

Additionally, in Construct 2, global variables can only be number or text values, but instance variables can be number, text, and/or boolean values.

I hope this tutorial helps! Have a great day!



  • Order by
Want to leave a comment? Login or Register an account!