Pause menu doesn't process

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By richgebs3

I’m following Godot’s tutorial for pausing a game here. Under the root node for my scene, I have the “main scene” that I want to stop when pausing, and I also have a hidden “pause menu scene” that I show and want to process when pausing. The “pause menu scene” is instanced and has its “Pause → Mode” property set to “Process”. I have a “pause button” that the player can click to pause or unpause the game. Its pause mode is also set to “Process”. No other pause modes for any other nodes have been changed from the default “Inherit”.

The result is that, while the pause menu does appear, it acts as though it is paused. None of the signals in that sub-scene fire off, nothing animates, no _process or _physics_process functions are called. I have a feeling that this has something to do with the fact that the pause menu is an instanced scene, since the button the player clicks to pause/unpause the game still processes, but it isn’t instanced.

:bust_in_silhouette: Reply From: LuisAnge45

hi, have you tried to put in the pause mode process on the node where the script is?

Do you mean that I should set the Pause → Mode to “Process” on the node where the script is? Or do you mean that I should put the script on the pause menu node?

I have tried the former, since the latter would require a lot more reconfiguring. The node with the script is the root node of the scene. Setting its pause mode to “Process” caused two unwanted behaviors, one expected and one unexpected:

  • The “main scene” continues processing (expected, since its pause mode is set to “Inherit”, I would assume that it inherits the property to keep processing when paused from its parent node).
  • The “pause menu scene” stops processing (unexpected, since its pause mode is set to “Process”, I would assume that it would continue processing even when paused, but it didn’t).

richgebs3 | 2021-02-02 17:16

:bust_in_silhouette: Reply From: richgebs3

I’ve discovered the reason why my pause menu was not working. The menu is made of pickable collision areas rather than buttons. During pausing, even though the _physics_process function is called, physics doesn’t get simulated, which means the mouse_entered and mouse_exited signals that the menu relies on never get fired. Here’s an issue filed on the Godot Github that explains what’s going on: https://github.com/godotengine/godot/issues/39094.

The solution is to use proper Control GUI objects like Buttons to make pause menus, as they can still have their signals fire. And if you’re trying to do something 3D that’s pickable with the mouse, you’re SOL.

so im SOL… what a nice day.

morningkingdom | 2021-05-09 14:11