When it comes to making games with animation, it is extremely common for the animation to need to stop or change when an event happens. For example, the player pressing the right arrow key may make the game change the character's animation to a running animation.
You will learn to do this through programming using GameMaker Language in a new object.
Every object in GameMaker has a set of variables that allow users to control what sprite an object has linked to it, as well as the animation speed, current frame, and more.
The following is the example code: