- Home /
Reset highScore in Java problem
Hi All,
I'm looking for a way to reset my high score.
I have a button on my main manu screen that should allaw to reset the high score.
The vars for this are: var highScore3DText : TextMesh; //The score text button var resetScoreButton : resetScore; //The reset text button
The highScore line is: function Awake() { highScore3DText.text = "High Score:" +PlayerPrefs.GetInt("highScore").ToString(); }
The function for the reset button is: function Update() { if(Input.GetMouseButtonDown(0))
{ ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if(Physics.Raycast (ray, rayCastHit))
{ if (rayCastHit.transform.name == "playButton")
Application.LoadLevel("mainGame"); //Load first level button
{ if (rayCastHit.transform.name == "resetScoreButton") //Press button to reset high score.
??????? = 0; //what should I use here? resetScore is not working.
}}}}
Is using var resetScore correct? I can't find any info on this. Please help.
Cheers
Your answer
![](https://koobas.hobune.stream/wayback/20220613112545im_/https://answers.unity.com/themes/thub/images/avi.jpg)