#Pause menu

7 messages · Page 1 of 1 (latest)

tawdry steeple
#

I don't understand. When i press esc. Pause menu pops up but game does not get paused. If i press esc again menu goes away and then Game pauses.
here's my scripts

worn snow
#

Is your root node set to "pauseable"? It's under process. Also, the default pause method is get_tree().paused = true / false and it will halt all actions in the scene. Anything that is supposed to still work (like your pause menu) should have the process type "When paused"

#

Also in terms of your code's complexity, you could just (in _process(delta)) listen for the Esc keypress, if so pause the game with get_tree().paused = true and change the visibility of/instantiate your menu (which has the "when paused" process chosen). Either add a way to unpause via a button in there or make the esc button flip between the bool

queen raptor
#

From a quick glance, it looks like get_tree().paused = !game_paused should be get_tree().paused = game_paused instead.

#

That also explains the behavior of pausing on closing the pause menu

tawdry steeple
#

Thank you Erebos For the tips!