Hi! I just finished a project and once the player reached the end of the game, I would like to reload the entire game. At first I tried to do it the "clean" way, by using a function called reload_game() that reset some variables etc, but I realized there are a lot of objects I have to instance again, and other stuff I would like to not have to deal with. So I decided to try to find another (dirtier) way to do it. Something that may not be optimal or nice, but is simple enough and actually works.
I red about the function called get_tree().reload_current_scene() and tried to use it at the root of my game (on a script of the "world" node), but when I Calle the function, the game crashes. As far as I can understand, there's something going on with my autoload, because it seems that it contains null objects. I don't understand why, since by reloading the root node, I thought it would reload the entire project, and my autoload with it (since my autoload is a child of the root node).
Is there another way to reload the entire game in a very simple way?
Ideally, something that's similar to closing the game and reloading it. In LOVE2D, my previous framework, there was a function called love.event.quit("restart") that was basically closing the program and opening it again. Is there something similar in Godot?
Thanks for the help!