Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | mr.fies |
Hi,
i have only one script in the root-node.
extends Panel
var quit_requested = false # if user wants to quit the game
...
func _process(delta):
if quit_requested == true:
get_tree().quit()
pass
if Input.is_action_just_pressed("MainMenuPressed"):
mainmenu.show_modal()
pass
func _on_BeendenButton_pressed(): #Main Menu
quit_requested = true
mainmenu.hide()
pass # replace with function body
mainmenu is a popup-node
the quit-button (BeendenButton) is in this popup
The problem here is, that quit_requested is not set to true. So it seems that I dont know how the popup can change a global variable.
Before I tried a direct get_tree().quit()
instead of quit_requested = true
but that didnt work, maybe the same problem.