Question by
mullac51 · Feb 07, 2017 at 03:40 PM ·
playerprefsif-statementsscore systemrestart
Saving Highscore with PlayerPrefs not working
I am trying to save a highscore so every time i restart the game the high score stays the same unless it's beaten. The code I have currently doesn't save a highscore.
Here is my code so far:
if (count > best)
{
PlayerPrefs.SetInt("best", best);
}
if(best > count)
{
best = PlayerPrefs.GetInt("best");
}
Comment
Your answer
Follow this Question
Related Questions
Invoke restart doesn't work 0 Answers
In the next scene tell player there score out of total using player prefab before next level 1 Answer
How do I call an if and else statement on a Countdown timer Script 0 Answers
Highscore and PlayerPrefs unity C# 1 Answer
In the next scene show the score using player prefab before next level 1 Answer