hi all, i'm making pause menu for my asteroids game and i've encountered this issue
i have a button in my main scene called settings_button with the following script attached, also the pause mode is set to process
extends Button
var settings_scene = preload("res://ui/settings.tscn")
func _on_settings_button_pressed():
var settings_instance = settings_scene.instance()
get_parent().add_child(settings_instance)
the settings scene that is instanced in the above code looks like this

the pause mode in this scene is also set to process
this scene also has an exit button with the following script
extends Button
func _on_exit_pressed():
get_tree().paused = false
get_parent().queue_free()
when i click the settings button, the game pauses and the settings scene is instanced and added to the main scene, and when i click the exit button i successfully exit that scene, but when i click the settings button again, nothing happens
any idea?
thanks in advance
edit:
so i tracked down the issue to a bug in my exit.gd script
the last line should be like this
# get_parent().queue_free()
get_node('../..').queue_free()
bacause the settings node was two node up