Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Erethan · Jan 24, 2017 at 12:17 AM · webglplayerprefs

Is PlayerPrefs product specific on WebGL?

On Windows, the PlayerPrefs location depends on the company name and on the product name. Is PlayerPrefs product specific on WebGL as well?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Erethan · Jan 24, 2017 at 06:37 PM

The answer is no. I've done some testing. I am confident to say that PlayerPrefs is not product name specific. Different products can share the same key. However, unfortunely each different Kongregate upload have a diferent access path. This means that if I put the new game in the place of the old game, PlayerPrefs would achieve the desired effect, but for obvious reasons this is inconceivable.

The tests methodology: I have created 3 different builds in the same project. They save or load with the respective commands PlayerPrefs.SetString("EricCardTest","Success") and PlayerPrefs.GetString("EricCardTest","Failed").

Build number - Build name- Functionalities

B1 - Game1 - Save and Load

B2 - Game1 - Load

B3 - Game2 - Load

Then I've done 5 uploads in the respective order on two different Kongregate Games - K1 and K2

Build Number - KongGame - Status

1) B1 - K1 - Failed, then Succeeded. (First run was used to save data)

2) B2 - K1 - Succeeded

3) B2 - K2 - Failed

4) B3 - K1 - Succeeded

5) B3 - K2 - Failed

Conclusions: Because, uploads 1, 2 and 4 were a success, PlayerPrefs does not differ project names. As all uploads in the game K2 were a failure, PlayerPrefs (at least on Kongregate) uses not only the domain(www.kongregate.com) and port, which is the same for all games, but it does use something else. Prehaps it uses the full URL?

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image marcowiprojects · Mar 26, 2020 at 12:15 PM 0
Share

excellent answer, extremely professional! thanks, it helped me too!

avatar image
0

Answer by Bunny83 · Jan 24, 2017 at 04:01 AM

Like pretty much everything that lives in a browser is bound to the domain / URL of the page. So even when you host the exact same game on two different webservers / domains, they can't access the playerprefs of each other.

As you can read here Unity uses the IndexedDB API to store the playerprefs for WebGL builds.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Erethan · Jan 24, 2017 at 12:57 PM 0
Share

The question regarded different products, not different domains. In the same domain but two different games. Do they share the PlayerPrefs folder?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

67 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Playerprefs.setInt generates errors in webGL 0 Answers

Why do PlayerPrefs become empty when uploading a new WebGL game version to Facebook 0 Answers

LoadFromCacheOrDownload and PlayerPref.SetFloat (WebGL) 1 Answer

Enable IndexedDB for webGL build Unity ? 0 Answers

External Javascript call in Unity WebGL 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges