How To Pause Your Game – GameMaker Studio 2

Everyone needs a break while playing a game, learn how to add that functionality to your game here! It’s versatile, and you can use it for GMS 1 and GMS 2.

Source Code: (notepad document)

– Connect with me on Twitter @Aaron_LLTT:
– Become a valued Patron and receive more exclusive content @:
– Wanna hear from other developers in the industry? Head on over to my podcast, DevTalk, to listen to engaging conversations I have with various successful developers:

My Exclusive Courses💻🎮:
– Bundle Course Package & More Here!

Outro Music courtesy of OC Remix.


Xem thêm bài viết khác:

Article Categories:


  • Is there any way to stop from drawing sprites that are not visible? Such as transition areas and such.

    Josephine Powell July 23, 2020 5:16 pm Reply
  • This works great thanks! Only thing is some instances in my game are marked as not visible, but they are drawn to the screen in my draw event. So I put this line
    if instance_find(all, i).visible == true {
    around my draw_sprite_ext code, but I get the error that unknown_object.visible not set before reading it. How can a built in variable not be set? By default all objects are set to visible so I'm not sure why I get this error, can anyone help plz?

    Danny Jensen July 23, 2020 5:16 pm Reply
  • That's a cool system. One small thing I'd like to point out is surely it's more efficient to assign instance_find(all, i) to a variable, and reference that variable within the for loop? Currently, you're calling instance_find 10 times per loop as opposed to once per loop. Small, but might help

    TheDaywalkr July 23, 2020 5:16 pm Reply
  • Wow! This was incredibly helpful!
    I was actually going to do something kinda simple like take a screenshot and paste it over but I like your method better. Thanks for the video!

    Razorik July 23, 2020 5:16 pm Reply
  • it doesnt work anymore :/ . i get an error that i havent said if it was flase or true before if statement. if i do esc key does nothing

    Darth Stal July 23, 2020 5:16 pm Reply
  • 9:20 – Wrong! It works like that in other languages, but not in GML! "i" will be destroyed after WHOLE event "Key Press – Escape" will be executed.
    It's easy to check:
    for (var i = 0; i < 10; i++)

    new_variable = i;
    That will not create a mistake. "new_variable" will be equal to 10.

    Igor Sandu July 23, 2020 5:16 pm Reply
  • You could just catch all the objects at application surface, store the surface, and then just draw it until unpause.

    silent_lesch July 23, 2020 5:16 pm Reply
  • Thanks for the tutorial. I read about a similar way to do this, which proved to be working quite well for me. Just before you deactivate the objects, you take a screenshot of the screen and display it. You do it through creating a sprite from the applicaton surface and save that sprite in a varible. Then draw the sprite on the surface. This way I didn't have to manage all the different objects. And when unpaused you destroy the sprite.

    J_C July 23, 2020 5:16 pm Reply
  • Hi Beyond Us Games. I have another problem that I'm not able to solve.

    When paused, other objects start to appear on top of the player. I assume this has to do with the fact that they're redrawn after the player and therefore end up on top in the paused state. For example, if I walk up to a wall, I've made it so that the collision check only checks the bottom of my character, and therefore the character is beheaded by the wall when I pause. Any suggestion for an easy fix on controlling in which order things are redrawn during the pause? Sorry if I'm just missing something simple here but I'm rather new to data structures and arrays overall.


    Taencred July 23, 2020 5:16 pm Reply
  • nice work!

    Elmin NCF July 23, 2020 5:16 pm Reply
  • Hey could you do a 2.5 Denison tutorial I've been trying to make my own with no luck

    Edit: for a platformer

    Dino Donut Man July 23, 2020 5:16 pm Reply
  • Hey, could you make a tutorial Projectile Motion in GMS2?

    Galewolf July 23, 2020 5:16 pm Reply
  • thanks for this helpful video, and your udemy course also seems to be interesting. are you actually planning to make an advanced udemy course one day?

    Aqare July 23, 2020 5:16 pm Reply

Leave a Reply

Your email address will not be published. Required fields are marked *