HighScore wont save Through PlayerPrefs

So i’m learning how to make game apps myself and so far i’ve been doing amazing! very pumped but I encountered an issue that I don’t exactly know what’s wrong as everything is running and coded right… as far as I know that is.

So here is my code

static int score = 0;
	static int highscore = 0;

	static public void AddPoint(){
		score++;

		if (score > highscore) {
			highscore = score;
		}
	}

	void Start(){
		highscore = PlayerPrefs.GetInt ("highscore", 0);
		score = 0;
	}

	void onDestroy(){
		PlayerPrefs.SetInt ("highscore", highscore);
	}

Highscore just won’t save… it keeps updating everytime I get a score but restarts to 0 when I replay the game… thank you.

Please make sure you are calling the Save method on the PlayerPrefs object to save it. I don’t see that anywhere.

PlayerPrefs.SetInt ("highscore", highscore);
PlayerPrefs.Save();

Also make sure that the first ‘O’ in onDestroy() is capital, so it looks like OnDestroy()

That’s probably what causes it to not save