Persistence of PlayerPrefs in WebGL
Hi all, I am fighting with PlayerPrefs in my WebGL build as I want to have persistence between sessions and everything works great.
BUT when I build a new release, the PlayerPrefs do not exist anymore. I search around the web and this seems to be the problem because the persistentDataPath changes. But how can I find the old saves? Should I hardcode a directory and not use PlayerPrefs at all?
I am really stumped here :( Thanks for answering in advance!
http://previewlabs.com/writing-playerprefs-fast/ Don't know if this will help your problem, but this is what I use for Playerprefs and haven't had any problems with WebGL. It Saved them to a text file with the option to encrypt them. Then you could add Debug.Log ("Saved To " + Application.persistentDataPath + "/PlayerPrefs.txt");
after the Flush(); call. That will show the location of the saved file.
Answer by musickgm · May 25, 2017 at 12:37 AM
@Nurator I'm having the exact same problem. I even tried using the PreviewLabs solution mentioned previously. I've been stuck on this problem for months (PlayerPrefs saving in WebGL between sessions but erasing when I push an update). Any suggestions much appreciated!!!