I wrote this code to count player score and keep player highscore but for some reason on line 37, column 27, it says "High Score: " is wrong and gives me this error: “The left-hand side of an assignment must be a variable, property or indexer”. Any help is welcome! Here’s all the code:
public Text scoretext;
public Text hscoretext;
public float scorecount;
public float hscorecount;
public float PPS;
public bool SI;
void Start()
{
if(PlayerPrefs.HasKey("HighScore"))
{
hscorecount = PlayerPrefs.GetFloat("HighScore");
}
}
void Update()
{
scorecount += PPS * Time.deltaTime;
if(scorecount > hscorecount){
hscorecount = scorecount;
PlayerPrefs.SetFloat("HighScore", hscorecount);
}
scoretext.text = "Score: " + Mathf.Round (scorecount);
hscoretext.text = "High Score: " = hscorecount;
}