Search Unity

Get Playerprefs of unity 4.x in unity 2017 ?

Discussion in 'Editor & General Support' started by shahrukh_hp1, Nov 26, 2018.

  1. shahrukh_hp1

    shahrukh_hp1

    Joined:
    Aug 16, 2016
    Posts:
    15
    I have recently updated unity 4.72 to unity 2017 , but with new unity it looks like older playerprefs are not accessible.It creates its new playerprefs, I read somewhere online that since unity 5.3 they have change playerprefs file name. So game's saved data is lost that was saved from unity's older version.

    Please suggest how do I read playerprefs of unity 4.7 in unity 2017 ?
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    It might help if you mentioned what platform you're talking about, since each platform saves playerprefs differently. In Windows standalone for example, they aren't even saved in a file, but in the Windows registry. If the location changed you could try using standard Windows registry access methods to get at the old data. (haven't tried it, just what I would look into first)
     
    shahrukh_hp1 likes this.
  3. shahrukh_hp1

    shahrukh_hp1

    Joined:
    Aug 16, 2016
    Posts:
    15
    Thanks for responding Joe , I am basically looking for android. I do heard about windows , that payerprefs are in registry which can be read but for android I don't know how and where can I read playerprefs . Any suggestion or example ?

    Thanks
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    What happens exactly when you try to read (and write) PlayerPrefs with the newer version? Keep in mind that uninstalling and reinstalling a game also removes PlayerPrefs.
     
    shahrukh_hp1 likes this.
  5. shahrukh_hp1

    shahrukh_hp1

    Joined:
    Aug 16, 2016
    Posts:
    15
    Of course when game is fresh installed (after uninstall),that ain't problem because player prefs are removed already, but when game is installed (with installed build of previous version of unity 4.7) the update (with build of newer unity 2017) is simply updated , but after this update newer build can't read playerprefs of older version (score and levels cleared all gone) . With newer version new playerprefs are made -

    now I experimented after that too :
    Newer build of game saves its scores etc perfectly, but then I installed the older apk again (updating game with older unity build) the game now recovers all the older saved data (scores and levels) that was lost previously .

    My understanding : unity 4.7 keeps playerprefs at some place other than unity 2017 keeps its playerprefs or just with different filenames.