`get_tree().paused = true` not working when setting unrelated node process mode to `When Paused`

Godot Version

4.3

Question

In my root Base node I have function for transitioning between areas. During the transition it pauses the game.

func _on_goto_area(scene:PackedScene):
	get_tree().paused = true
	TransitionScreen.fade_in()
	await TransitionScreen.faded_in
	var new_level=scene.instantiate()
	areas.add_child(new_level)
	new_level.connect("goto_area", _on_goto_area)
	old_level=current_level
	current_level=new_level
	TransitionScreen.fade_out()
	get_tree().paused = false

The TransitionScreen is a global scene.

The problem is that when setting the process mode of node SelectionWheel in the game ui to When Paused, the game will no longer pause when transitioning. The game pauses properly again when this node is set back to Inherit.

The structure looks like this,

image

Any help would be greatly appreciated :sweat_smile:

Just to add, if I print the name and the paused value of get_tree() after setting paused to true, they equal Base and true. So it is telling me my root node is paused, but the game isn’t pausing :thinking:

So I have a current workaround, which is replacing, get_tree().paused = true with get_tree().root.process_mode = PROCESS_MODE_DISABLED and get_tree().paused = false with get_tree().root.process_mode = Node.PROCESS_MODE_PAUSABLE.

I will leave this thread open for any discussion as to why my initial code isn’t working here. get_tree().paused = true still works perfectly fine while bringing up my selection wheel.

The problem was the code for my selection wheel was constantly unpausing the game :person_facepalming: