[SOLVED] How to pause the game when a popup is open, properly?

Hi guys :waving_hand: it’s me again.

I am wondering about the subject.

I have a game level. It contains a game object with a GUI component. I want to pause the level when a popup from the GUI is open. So chatGPT recommended using this code

msg.post("level_proxy", "set_time_step", {
    factor = 0,
    mode = 0
})

But, in that case, everything pauses along the level. I mean I have a lot of animations and particles inside the GUI component, and they are also paused.

I tried to put the GUI in a separate collection, but it doesn’t help. I am sure that my case is obvious and common, and the community has a “best practice” to solve this.

1 Like

You’re on the right track with using a separate collection. The collection for your pause menu will need to sit above or parallel to the collection you’re pausing though.

3 Likes

Perhaps this video might guide you well here:

3 Likes

Oh! I get it! Thanks!

1 Like