All my game texts are GUIText and i’m trying to create a high score to display after each game ends. Every time i try to make an ‘if’ statement for when the score is higher than the highscore to change the highscore to that score, it either tells me you can’t use ‘>’ with GUIText or strings. here’s the end of my script where this is occuring, let me know if you need to see more script:
public void AddScore(int newScoreValue)
{
score += newScoreValue;
UpdateScore();
}
void UpdateScore()
{
scoreText.text = "Score: " + score;
}
public void GameOver()
{
gameOverText.text = "Game Over!";
gameOver = true;
highscoreText.text = scoreText.text;
if (scoreText > highscoreText) //this is where the problem is but there may be more issues
{
highscoreText.text = scoreText.text;
}
}