PlayerPrefs script does strange things

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. : )

You are not setting the interger current to anything in this code. Try

current = PlayerPrefs.GetInt("current") + 2;
PlayerPrefs.SetInt("current", current);

Oh… it works :smiley: thanks man!
but thats odd… i tried that before and got an error:

cannot convert system.type to int.

why its working now? Or what was wrong when i got this error?