Skip to main content
/assets/images/variable-scope-3fae2bbf64e6b8f3a45deb045d7b314e.png

Variable Scope

warning
This section is currently under construction. Please reach out if you require any assistance

Global Variables

Global Variable Icon Variables store a single value or a set of values that can be accessed and updated from anywhere in your Experience Icon Experience. Because a Global Variable Icon Variable exists as a single instance (i.e., there is only one version of the Variable Icon Variable), any updates to its value are automatically reflected everywhere it is referenced in your project. This makes Global Variable Icon Variables ideal for storing widely accessible data, such as the number of trials completed, participant's score, audio files, colours and more. Global Variable Icon Variables are the default type of variable in Labo.

Object Variables

Object Variable Icon Variables do not hold one common value (like Global Variable Icon Variables) but rather have distinct versions which all hold their own individual values. They can hold different values based on the object (Interactive Icon Interactive) they are associated with. This means each object can have its own version of the variable with a different value, even though all values are of the same type (e.g., numbers, text). This is particularly useful when you want each object to have personalized values. For example, imagine you are creating a virtual shopping experience where participants can pick up items from a shelf. You might create an Object Variable Icon Variable called "Price" to store the price of each item. Even though all items reference the same "Price" variable, each item has its own unique price value.