Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

PlayerPrefs won't save in registry?

Discussion in 'Editor & General Support' started by crypt0, Sep 9, 2016.

  1. crypt0

    crypt0

    Joined:
    May 25, 2015
    Posts:
    55
    Hi,

    some users of my windows build have the problem, that the playerprefs won't save?! I can't reproduce this issue and I have no idea, what's going wrong. For example, I am using Rewired from the asset store as input system.

    Yesterday, I wrote a while with an user in a chat to find the error. He is running windows 10 with admin permissions. He downloaded the game several times - he copied the game to several locations. He has only running the windows defender and he has disabled it. There are only a few things who has saved in the registry:

    Screenmanager Is Fullscreen mode_hxxx
    Screenmanager Resolution Height_hxxx
    Screenmanager Resolution Width_hxxx
    unity.cloud_userid
    unity.player_session_elapsed_timer_hxxx
    unity.player_sessionid_hxxx
    UnityGraphicsQuality_hxxxx
    UnitySelectMonitor_hxxx

    Normally, I do save some values at the beginning - Only a few (100-200) users have this problem and I have no idea what happened or how to fix this issue.

    The user then copied the game to his laptop and it works...

    Does anyone have any idea what happened?

    Thanks and Cheers
     
  2. crypt0

    crypt0

    Joined:
    May 25, 2015
    Posts:
    55
    Hi,

    a user startet the game in a box and it works - so any ideas what does blocked it?

    User comment:
    "Ah thanks! I installed it on a win 7 box and works fine! Great work sir !"

    Cheers
     
  3. Westland

    Westland

    Joined:
    Jan 26, 2015
    Posts:
    26
    Probably am way past this issue now, but in case someone else comes stumbling past (like I did).

    I had a similar issue - was using PlayerPrefs to save values for UI sliders, controlling audio mixer volume levels. The first value worked fine, the three other sliders with exactly the same code (excepting their different names, of course) wouldn't save at all.

    Initially, PlayerPrefs worked fine (atleast for the first slider) - but I deleted the registry-entry for the game (probably a mistake), changed the Company Name in Edit > Project Settings > Player and then it stopped working completely. Tried restarting Unity, rebooting.. But no PlayerPrefs has since appeared.

    So eventually just switched to loading & saving the data myself, which works entirely as expected. Tried looking for solutions, but only came across a bunch of folks saying 'saving in registry' is a bad practice.. So saving and loading data manually would be my recommendation. Piece!
     
  4. berk_can

    berk_can

    Joined:
    Feb 8, 2016
    Posts:
    15
    for people encountering this issue, what solved it for me was to go and click Edit->Clear All PlayerPrefs and select Yes on prompt, afterwards it starts to work fine
     
    kypronite and Westland like this.