Not saving in build
-
- Posts: 69
- Joined: Thu Dec 08, 2016 7:34 pm
Not saving in build
Not sure what I am doing wrong here. I am using the prefs editor to add two new Player Prefs "PlayerName" and "PlayerCountry" as strings. Since I don't have the input menus set up yet, I just put in default values and then save the whole thing. Works great in the Editor, but when I build (both for Web Gl and Windows) the values are not saved. I can't tell if just the default values are not saved or whether the new Player Prefs themselves are not saved.
Re: Not saving in build
Are you adding the preferences through the Prefs Editor window? If so then Player Prefs are only available on the machine where they are created - there is no automatic copying of these over to a different machine, and different builds use a different storage location.
You might need to add a basic component to set these from code if you need them initialising.
You might need to add a basic component to set these from code if you need them initialising.
-
- Posts: 69
- Joined: Thu Dec 08, 2016 7:34 pm
Re: Not saving in build
Ok, I wrote some code to enter the defaults into the Player Prefs at the start of the game.