Node within viewport not receiving input when game is paused

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

I have a scene tree that looks like this:
scene tree
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.

:bust_in_silhouette: Reply From: nficca

After some troubleshooting I came across this reddit thread which led me to try setting the ViewportContainer’s pause mode to Process. It worked, and I was able to pause/unpause just fine.

Of course, this means that all nodes within the viewport container don’t pause, including gameplay related nodes. Not ideal, but I’m working around this by grouping nodes that should pause under one parent that has pause mode set to Stop, and vice versa for the nodes that shouldn’t pause.