func _notification(what):
if (what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST):
print ("You are quit!")
get_tree().quit() # default behavior
-j
Not working.
When I close the game nothing happens in output console.
Gleb | 2017-11-16 11:10
Strange. Have you insert this function in main script?
jospic | 2017-11-16 13:32
Sorry, what do you mean main script? I can’t understand how can script can be not main in Godot. I insert this function in script of the scene where I want to save the game when it close