Always use var for temporary variables inside events to prevent memory leaks.
"GML is the duct tape of game dev – messy, odd-smelling, but absolutely perfect for the job it was designed for." gamemaker studio 2 gml
It isn't all perfect. Here is where the engine shows its age or limitations: Always use var for temporary variables inside events
// Speed and direction (built-in variables) speed = 4; direction = point_direction(x, y, mouse_x, mouse_y); // Move toward mouse direction = point_direction(x
Building a feature in GameMaker Studio 2 using GML (GameMaker Language)