Restarting the game without losing the variables

Hello guys, I was working on game that when the player dies the game restart after a while but when the game restarted all the values in variables resetting to 0, so how I can restart my game without losing my values.

If you just want the player to keep their variables between levels of a continuously running game, you can put the variables in a Game Instance (be sure to add your new game instance as the one being used in the project settings!)

If you want to let the player stop playing the game and then turn it on again later with all their variables, you should use a save game object.

Here is a video on Game Instance, and Here is a video on save game.

1 Like