Variable Scope [GameMaker Studio 2] @SamSpadeGameDev
Variable Scope [GameMaker Studio 2]  @SamSpadeGameDev
Uploaded January 2020 | Updated December 2026, 3 hours ago
A short tutorial about what variable scope is and how to use it in GameMaker. Part of the Coding Fundamentals in GML Tutorial Series in GameMaker Studio 2

Patreon Support
patreon.com/samspadegamedev

Links:
docs2.yoyogames.com/source/_build/3_scripting/3_gml_overview/6_scope.html
en.wikipedia.org/wiki/Scope_(computer_science)
Github (source code and slides)
github.com/samspadegamedev/GML-Coding-Fundamentals/tree/master

Outline
0:00 What is variable scope?
1:21 Global Scope
2:15 Instance Scope
3:28 Local Scope
4:20 Scope Overview
4:54 Code Example
7:29 Summary

#GameMaker
#CodingFundamentals
#GML
Variable Scope [GameMaker Studio 2]Error Messages in GameMaker are GoodObject Inheritance [GameMaker Studio 2]Simple Buttons in GameMaker Studio 2, 2.3!How to Get Code from Github on Your Computer in SecondsThe GameMaker Community Public Service AnnouncementSound and Hover in GameMaker 2.3Creating Islands with Cellular Automata in GameMaker Studio 2.3.1Functions [GameMaker Studio 2]Adding States and RefactoringSimple GUI Buttons in GameMaker Studio 2The Dangers of Lets Make a Game Tutorials
SamSpadeGameDev |

Variable Scope [GameMaker Studio 2]

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER