Answer the question
In order to leave comments, you need to log in
I can't create a save method using playerprefs, what should I do?
Swears at how I call the key. Namely, on LvlNomer, he writes that it does not exist in this context. How to declare a key name then?
public void Save()
{
string key = “LvlNomer”;
PlayerPrefs.SetInt(key, this.lvl);
PlayerPrefs.Save();
}
Answer the question
In order to leave comments, you need to log in
Answer from user GavriKos:
In the line string key = “LvlNomer”; incorrect quotes, that was the problem.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question