Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | weinzierl |
I wanted to play a very short animation when the player quits the game. I put the animation in a separate scene called Outro.tscn and tested it to make sure it works. Now I tried to play it on an Quit Request like this:
func _notification(what):
if what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST:
print("Quitting requested...")
print("Playing Outro and Quit!")
get_tree().change_scene("res://Outro.tscn")
The functions gets called properly and both print lines are shown but the the Outro Scene is not played and there is no error shown either.
I would like to understand why that doesn’t work and I’m looking for a way to make the animation play whenever the game is quit. Glad if anyone could help!