BCE0022: Cannot convert 'String' to 'int'
So I am trying to display the value of a Highscore that the script stores even when the game is closed using PlayerPrefs.SetInt("Highscore").
But when I try to display the value that it stores on a UI text it can't extract it from the (''Highscore'') string and this message shows: BCE0022: Cannot convert 'String' to 'int' .
Do you know how can I make it recognize this string as an int?
This is the code:
function Update (){
scoreDisplay.text = "Score: " + playerScore; highscoreText.text = "Best Score: " + PlayerPrefs.GetInt("Highscore"); }
The text displays everything else correctly except for what I've mentioned. playerScore is an int variable saved outside the Update function and is displayed fine on the text. Dont know if I explained myself properly. Hope some one can help, thanks!