- Home /
PlayerPrefs not saving in build
Hello Guys,
My problem is:
I am using PlayerPrefs for saving and loading. everything works as expected...in the editor... but when i make a pc build its not working.
i also tryd to call it while OnApplicationPause as told here: http://answers.unity3d.com/questions/1362755/playerprefs-not-saving-on-android-but-saving-in-un.html
but it also not worked... i am using unity 5.6.2f1 64bit
the code isn`t the problem, thats why im posting none.
Thank you so much!
Did you check the PC's registry when playerprefs are saved if those keys are recorded?
Answer by Cuttlas-U · Oct 26, 2017 at 05:30 AM
hi; there should be no problem in saving player prefs; so there is some thing wrong in your scripts some where; i suggest u to install notpad++ and check all of your scripts to find if there is some where a code like : PlayerPrefs.DeleteAll();
no i never used the deleting function.... but i was thinking, is it a problem for unity that i already have saved variables in my scene and that i than build it. does this make a difference?
when u save a variable it will be saved on its machine; so when u build to android u have to save again the saves from pc wont be transformed to android;
AHW ok! i tryd to say.
if var x = 1 you can save. normally var x was 0 and i edited in the inspector and saved so that he will load var x as 1 not as 0. because i couldnt use the saves from the editor in the build var x was always 0 in the build version which didn`t allowed me to save :D
ok seems like u get it right ; tell me if u had any other problems with that ;