- Home /
PlayerPrefs when moving the webplayer
The PlayerPrefs settings are associated with the webplayer url.
Suppose I were going to move the webplayer to another url.
If I move - is there a way to access old PlayerPrefs settings by webplayer located on new url?
Answer by HarshadK · Jun 17, 2014 at 07:48 AM
I'm afraid not!
Because Unity stores PlayerPrefs with URL for the same reason the browser stores cookies as domain specific. And that reason is Security.
There is no in-built feature provided in Unity to support your need as it may compromise the security. So you are left with only one option which is to find a loophole and exploit it to employ a hack which may or might not work in all scenarios and will only be usable till Unity does not patch it. AFAIK, there is no currently known hack for what you are looking for. So you have no luck with Unity's PlayerPrefs.
To solve the issue of carrying forward player preferences, one way would be to store the player preferences in a database on a server by yourself. Then you can easily migrate that database to your new domain which will allow you to keep all previous player preferences. But for this you need to handles the storing and retrieving of player preferences by yourself. And you also need to introduce an update of existing version of game which will take current player preferences from the system of user and store them in your database.
$$anonymous$$arma Bug
You are totally right. I've tried deselecting the answer. No loss to you. Reselecting, no gain.
Upvoting Questions seems to also be broken, $$anonymous$$arma-wise.
@tomekkie2 You lost 2 $$anonymous$$arma when I tested the button here. (Over) compensated you in another thread.
I guess I can safely say, this recent maintenance is now costing users. Now how am I gonna pay my bills? ;-)
When storing the playerprefs on server database, you have to do it together with device identifiers like obtained from SystemInfo.deviceUniqueIdentifier.
Your answer
Follow this Question
Related Questions
Copy/Paste from WebPlayer or save as cookie 1 Answer
Updating txt from an url (webplayer) 0 Answers
PlayerPrefs - Error in webplayer 1 Answer
Load image from url in Webplayer 1 Answer