I want to increase a PlayerPrefs saved var: current.
the script:
if(collision.gameObject.name==“Goal”){
PlayerPrefs.SetInt(“current”,(PlayerPrefs.GetInt(“currnet”)+2));
Debug.Log(current);
}
At the beginning, current is 1. Everything is ok.
But if the Player collides with the “Goal”-object, current sets itself to the
number i want to add… (in this case 2) and if i put a 3 there, current sets itself to 0. 13=0 ??? I really wondering whats wrong…
Thanks for your attention. : )