Hello. I would like my game to be able to keep highscores but I’m not sure how to do so. I have seen some answers concerning that but I don’t quite understand. Do I have to use “PlayerPrefs” to keep the score? How do I display it at the end of the game; do I have to create another scene? This is the current score scripts that I’m using.
Attached to GUI text:
static var score : float = 0;
function Update ()
{
guiText.text = "Score : " + score;
}
This is the script to increase the score:
var score = 0;
function OnTriggerEnter (other : Collider)
{
keepscore.score += 25;
gameObject.active = false;
Destroy(gameObject);
}
Thank you for your help.