Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

PlayerPrefs not Persistent Between Builds

Discussion in 'Scripting' started by BobbyDoogle, May 2, 2015.

  1. BobbyDoogle

    BobbyDoogle

    Joined:
    Dec 3, 2013
    Posts:
    15
    I'm working on getting a title together for release, and it appears PlayerPrefs is getting wiped/cleared every time I make a new build. I want my Players Saves (which I am doing via PlayerPrefs) to not be deleted if the build is updated, how would I go about this?
     
  2. hamsterbytedev

    hamsterbytedev

    Joined:
    Dec 9, 2014
    Posts:
    353
    Could always try to serialize that data to a file instead of using PlayerPrefs. Also, I don't think PlayerPrefs clears for new builds. I'm certain I've released several iterations of my Android games and still retained all data that was saved in PlayerPrefs. Is there something you are doing to clear the PlayerPrefs every time you release a new build manually? What is your target platform?

    You may want to review this link:

    http://gamejolt.com/community/forums/topics/unity-web-playerpref-is-reset-when-game-is-updated/1736/
     
  3. pws-devs

    pws-devs

    Joined:
    Feb 2, 2015
    Posts:
    59
    Your new build might not be able to find the right references for PlayerPrefs, if when building a new build, the ProductName or CompanyName or some product identifier in the build settings is different. You would probably need to check that.
     
    hamsterbytedev likes this.