1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. We want to know how you learned Unity! Help us by taking this quick survey and have a chance at a $25 gift card
    Dismiss Notice
  5. Unity 5.6 is now released.
    Dismiss Notice
  6. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice

PlayerPref overwrote problem

Discussion in 'WebGL' started by stylophone, Jan 27, 2016.

  1. stylophone

    stylophone

    Joined:
    Aug 16, 2012
    Posts:
    23
    Hi. Let's say I have two games that are hosted on a same server/domain but with different path and url, both of them are sharing with the same key for store player's best score. Let's say the key name is "BestScore". And When I do PlayerPrefs.SetInt("BestScore", 10); in Game A. The result will also affects the Game B. And both of the games "BestScore" will be changed to 10...

    I can't find the document that explains how the PlayerPref works on WebGL but I guess it's because of the same domain and the same key name?
     
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,046
    Thanks for reporting the issue. We identified the problem and we are implementing a fix.