Construct 2 Basics - Variables

Stats

1,958 visits, 2,728 views

Translations

This tutorial hasn't been translated.

Tools

Variables

Summary

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!

Best,

      Gio
  • 0 Comments

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