Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

PlayerPrefs doesn't save in WebGL

Discussion in '2019.1 Beta' started by pedro_unity228, Mar 26, 2019.

  1. pedro_unity228

    pedro_unity228

    Joined:
    Jul 3, 2018
    Posts:
    4
    I made a tiny project and it proves it out. It has a single text input field and all it does is load and save to PlayerPrefs. It works fine in editor and on standalone builds.

    Project files: https://drive.google.com/open?id=14IEXDxoynwUtpRbaf9Mljzr0g0E1_bbP

    However:
    - Exporting to WebGL with 2018.2.12f1 the application works as expected;
    - But exporting to WebGL with 2019.1.0b5 the application does not work -- it fails to save to PlayerPrefs.

    (when it works I can see /idbfs with key-value pairs in Application > Storage > IndexedDB. When it doesn't work /idbfs is not created. Interestingly /idbfs-test is always there, and so is UnityCache.)

    I tested the WebGL applications with FF and Chrome.

    ...help, please? We need PlayerPrefs for a lot of player account and device preferences persistence. Hopefully there's a workaround? We've already updated to 2019.1 a while back and I'm not sure how destructive the process of going back would be.

    Update: just tried with 2019.2.0a9 and it doesn't work either. The "/idbfs" database isn't even created. I tried creating it by hand to see if the application would save to it but no dice.
     
    Last edited: Mar 26, 2019
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Thanks for bringing this to our attention. Could you please submit a bug report for this issue and reply in here with the issue ID? You can find a guide on how to report bugs in my signature.
     
  3. pedro_unity228

    pedro_unity228

    Joined:
    Jul 3, 2018
    Posts:
    4
    Sure, here it is: Case 1140820

    Thanks!
     
    LeonhardP likes this.
  4. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136