in my game i want the player taking screenshots of the game. Am using playerprefs to save number of screenshots so i can have screen-1,screen-2 screen-3 etc the problem is it does not increment above 1 and i don’t know why here is my code
function Awake() {
if(!PlayerPrefs.HasKey("HighScore")){
PlayerPrefs.SetInt("HighScore",0);
}
}
function Encode{
Application.CaptureScreenshot( System.IO.Path.Combine(
System.Environment.GetFolderPath( System.Environment.SpecialFolder.MyPictures ),
"screen-" + PlayerPrefs.GetInt("HighScore") + ".png") );
yield WaitForSeconds(2);
PlayerPrefs.SetInt("HighScore",(PlayerPrefs.GetInt("Highscore")+1 ));
}
thanks for any help
thanks rookie mistake
– el-santia93i know am not supposed to ask another question here but would you mind if i did?
– el-santia93If it's a different question, ask a new question. It doesn't take long. Also search of someone already asked your question and if someone already answered that question, to avoid duplicate questions.
– Statement