Restart Entire Game

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By djmick

Hi, I am wondering how I would restart the entire game. I know you can reload a current scene, but I need everything to restart, as if the game has just been started. Do you know how to do this? Thanks

:bust_in_silhouette: Reply From: CassanovaWong

Maybe create a second project that instances the first project using OS.execute()?

var pid = OS.execute(OS.get_executable_path(), [], false)

And, when you want to restart, you’d just OS.kill() the first project’s PID and then call OS.execute() again.

There’s probably a better way, because this is actually instancing two projects running at once, but that’s what I could come up with.