Instanced scene is frozen and only responds to certain inputs

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

Hello, I have been creating a “Scene Switcher” recently, which works for the most part. Everything in the code works, however in the new instanced scene I can’t click on any options in the pause menu, but I can open and close the menu with the key I’ve mapped to it. I also have a checkbox in the new scene which I can’t click as well. I’m very close to having this work, but the scene is essentially frozen. Not sure what to fix, any help would be greatly appreciated. Here’s the code:

change_scene (autoloaded scene):

func change_scene(node, delay = 0.5):
    var pause_menu = preload("res://Scenes//PauseMenu.tscn").instance()

    var n = ResourceLoader.load(node)

    yield(animation_player, "animation_finished")


    var new_scene = n.instance()

    yield(animation_player, "animation_finished")



The PauseMenu (separate scene):

func _ready():
func _physics_process(delta):
	if $VBoxContainer/Map.is_hovered() == true:
	if $VBoxContainer/Options.is_hovered() == true:
	if $VBoxContainer/Quit.is_hovered() == true:

func _input(event):
	if event.is_action_pressed("PauseMenu"):
		get_tree().paused = not get_tree().paused
		visible = not visible

func _on_Resume_pressed():
	get_tree().paused = not get_tree().paused
	visible = not visible

func _on_Quit_pressed():
:bust_in_silhouette: Reply From: njamster

You’re adding the pause_menu after the new_scene.¹ Assuming the PauseMenu is a Control-node as well, it’ll consume all input events, thus your buttons don’t react.

On an unrelated note: Paths tolerate double slashes, but don’t require them (other than in the beginning). So "res://Scenes/PauseMenu.tscn" is the same as:

# and so on...

Also what you’re passing to change_scene isn’t a node but a path.

¹ However, I’m not sure why… Seems to have nothing to do with changing scenes?