Okay so im trying to make it so the players score is based on the time they survive. And I was trying to keep the highscore. I mushed 2 tutorials together and got this but its not working.
I want to connect the score from the script to a UI text.
Mabey Ive got this all wrong pretty fresh to unity.
{
public Text score;
public Text highScore;
void Start()
{
highScore.text = PlayerPrefs.GetInt("HighScore", 0).ToString();
}
public void HighScore()
{
int score = Time.deltaTime;
score.Text = score.ToString();
if (score > PlayerPrefs.GetInt("HighScore", 0))
{
PlayerPrefs.SetInt("HighScore", score);
highScore.text = score.ToString();
}
}
}