0 votes

I would like to restart the ENTIRE game, similar to how Rimworld does it when you change the mod list. Now Rimworld probably just restarts the content loading part of the game but I would like to restart the ENTIRE game, not the scene. I would also like to do this without the use of external scripts that start the game when run. Does anyone know if this is possible?

Godot version 3.4
in Engine by (559 points)

2 Answers

+1 vote
Best answer

Restarting an entire project isn't possible yet, but there's a pull request that exposes the editor's restart-on-exit functionality to projects.

by (11,917 points)
selected by
–1 vote

Restarting game is possible with remove_child(Node) and Scene.queue_free()ing every scene you instanced then Scene.instance() and add_child(Node). If this is not enough, call initializers in every Scene automatically. You can put initializers in the _ready() functions. For those global variables that imported with autoloads, just call initializer in their scripts.

by (236 points)
edited by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.