EDIT:
Hi, how can i make a local high score system? I want this to work so it saves my score IF it’s higher than my last high score. How can i do that?
EDIT:
Hi, how can i make a local high score system? I want this to work so it saves my score IF it’s higher than my last high score. How can i do that?
I didn’t understand your question, do you want it to show your score? thats it? if so add a new variable called score or something
var score : int = 0;
and then call the score variable here
GUI.Box ( new Rect ( Screen.width-150, 0, 150, 50 ),"Score: "+score);
thats it?
Hey guys, i made a local high score system myself based on my players z position. Hope this will help you if you want the same:
void Update () {
if ( transform.position.z > PlayerPrefs.GetInt ("highScore") ){
PlayerPrefs.SetInt ("highScore", Mathf.RoundToInt (transform.position.z ) );
}
}
And then here is the GUI.Box which shows me my current score (my z position) and my highest score.
void OnGUI() {
GUI.Box ( new Rect ( Screen.width-150, 0, 150, 50 ),"Score: " + Mathf.RoundToInt (transform.position.z) + "
High Score: " + PlayerPrefs.GetInt(“highScore”) );
}
If you have any questions about the system, please, just ask!
Cheers
set it up so when you die or finish a round the score is compared to the highscore, then if it is higher set a variable called highscore equal to the score. Then save it using playerPerfs or dontdestroy on load. If you need exact scripts just ask.