hey guys, im trying to add a value to a playerpref i already have, in this case +50, however the way ive been calling my playerprefs is like this
PlayerPrefs.GetInt("LevelPar1_" + Application.loadedLevelName)
i do this as i have many levels, but when i try to add to that playerpref, i get these errors
cannot convert int' expression to type string’
The best overloaded method match for `UnityEngine.PlayerPrefs.GetInt(string)’ has some invalid arguments
the line im using is this
enter code herePlayerPrefs.SetInt(PlayerPrefs.GetInt(Score), PlayerPrefs.GetInt(Score)+1);
score is set as the follwing
Score = PlayerPrefs.GetInt("LevelPar1_" + Application.loadedLevelName);
The line: PlayerPrefs.SetInt(PlayerPrefs.GetInt(Score), PlayerPrefs.GetInt(Score)+1); Is trying to set a player pref which is named whatever the player pref "Score"'s value is. I can't tell from your code but you probably want to be setting something with one constant name.
– Josh707