Old Save Data mysteriously appearing on Build

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
KingCeryn
Posts: 70
Joined: Sun Aug 23, 2020 5:12 pm

Old Save Data mysteriously appearing on Build

Post by KingCeryn »

So i constantly clear my saved data while working, but whenever i build i seem to have the same 3 save data slots in my system showing up, from months ago. Its not present anyone in the editor or play mode that i can find, but whenever i build it shows up in there. Any clue where i might find this and delete it?
User avatar
Tony Li
Posts: 21965
Joined: Thu Jul 18, 2013 1:27 pm

Re: Old Save Data mysteriously appearing on Build

Post by Tony Li »

Hi,

Are you using PlayerPrefsSavedGameDataStorer?

Unity uses entirely different sets of PlayerPrefs data for the Unity editor and for builds. If you want to clear the data in your build, you can call PlayerPrefs.DeleteAll() to clear all PlayerPrefs, or PixelCrushers.SaveSystem.DeleteSavedGameInSlot(#). For # you can loop through all the save slot numbers that your game uses. If there's no saved game in that slot #, it will ignore it.
KingCeryn
Posts: 70
Joined: Sun Aug 23, 2020 5:12 pm

Re: Old Save Data mysteriously appearing on Build

Post by KingCeryn »

I am using the Player Prefs Storer, yeah. Are these saves not located somewhere in the project folder? They only show up in the data on build.

Is there a way to prevent building with these mysterious old saves? I dont wanna delete them at runtime, i feel like thats asking for trouble.
User avatar
Tony Li
Posts: 21965
Joined: Thu Jul 18, 2013 1:27 pm

Re: Old Save Data mysteriously appearing on Build

Post by Tony Li »

This Unity manual page explains where PlayerPrefs are located on each platform.

For example, if you're using Windows, Unity stores PlayerPrefs data in the Windows Registry. When you make a build, Unity isn't making the build with that PlayerPrefs data. The PlayerPrefs data is separate, in the Windows Registry. When you run the build, PlayerPrefs looks in the Windows Registry and sees data there.
Post Reply