A way to restart the game

Thank you very much for the course I’ve learned a lot.
Im trying to make a restart button at the end of the level that reset the game.
I’m trying to make a reset button(that reset all the variables) instead of restart the whole scene but having hard time with that. anyone tried it by any chance?

Restarting the scene is a pretty standard way of resetting everything. It’s easy to miss something if you try to do it manually, not to mention the headaches that will ensue when things trigger based off of certain variables’ values, etc.
But, if you want to do it manually, there are ways.
One such way could be to fire off an event and every component must listen for it and reset its own variables when it fires. You would have to know what each variable’s initial value was, and in some cases, what order to change values in, etc.

1 Like

I see, thank you very much!

I concur with @bixarrio. You’ll go crazy trying to reset and respawn everything. Reloading the scene covers everything.

The thing is Im trying to make it multiplayer and I need to pass data about everything as well as restarting the game, reloading thw scene takes alot of time

You might consider the saving system from the RPG Core Combat course for saving and restoring data. The Json version of the system would be preferable for sending to servers. In terms of multiplayer, you’ll need to follow our Multiplayer course .

Privacy & Terms