Page 1 of 1

Not saving in build

Posted: Mon Jul 30, 2018 10:12 pm
by bradjensen68
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

Posted: Tue Aug 07, 2018 7:07 pm
by mahewitt
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.

Re: Not saving in build

Posted: Thu Aug 09, 2018 3:30 pm
by bradjensen68
Ok, I wrote some code to enter the defaults into the Player Prefs at the start of the game.