I have a scene tree that looks like this:

Inside the script for the PauseMenu
, I have code that toggles the paused
value of the scene tree:
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed("pause"):
get_tree().paused = !get_tree().paused
I've also ensured that the PauseMenu
's pause_mode
is set to PAUSE_MODE_PROCESS
(via the editor).
I am able to pause the game, but not unpause it. It seems that once the game is paused all my inputs are being either disregarded or consumed by some other node, unbeknownst to me.
Here is the quirk I'm confused about: if I move the PauseMenu
node to instead be a sibling of Viewport
(rather than a child), it all works. I am able to pause and unpause just fine.
Why is this happening? What can I do to fix this? Help is appreciated.