Set default highscore using player perfs?

Hello everyone! I was simply curious how I can set a default high score at the beginning of my scene.

In the Start routine of a gameobject present in the scene, just set whatever variable you are using to hold the high score to whatever default value you want.

If you are meaning you want to pull the current highscore from PlayerPrefs, but use a default highscore if there is no player pref, then just pass a default value when calling GetInt (or whatever method you are using)…

i.e.

int HighScore = PlayerPrefs.GetInt("HighScore", 10000);

This will return the current highscore saved in your prefs, or 10000 if no highscore was found.

Hope this helps,
-Larry