i have only one script in the root-node.
var quit_requested = false # if user wants to quit the game
if quit_requested == true:
func _on_BeendenButton_pressed(): #Main Menu
quit_requested = true
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.