Restarting the scene with save data

If you call the function
SceneManager.LoadScene to reload the scene, but you implemented save data in the start function, would it overwrite the save data and completely reload the scene or your save data would be loaded along with the scene?

An easy way to implement persistent data is by using PlayerPrefs.

With this you can do things like:

PlayerPrefs.SetInt("PlayerCoins", 100);

and

int playerCoins = 0;
if (PlayerPrefs.HasKey("PlayerCoins"))
{
    playerCoins = PlayerPrefs.GetInt("PlayerCoins");
}

To get and set data such as numbers of coins :slight_smile:

If you have multiple players who could play on a single machine or multiple “saves” then you might want to make a more involved system to handle the keys with which you save your data.