Exception calling PlayerPrefs.Set?() method

Hi there,

I had encountered a strange problem while running our application in some environments.

Specifically when I call PlayerPrefs.SetFloat(“somekey”, somevalue); I am getting this exception:

exception: UnityEngine.PlayerPrefsException: Could not store preference value
at UnityEngine.PlayerPrefs.SetFloat (System.String key, Single value) [0x00000] in :0

This happens on Windows 8.1 machine. My account is an Administrator, but app is not run in the admin mode. The exception does not occur when app is run in the admin mode. Nor it occurs when I run it on my Mac Book Pro and Mac Pro in both native OSX mode and Windows 10 through Parallels.

What could cause the issue? The application has its company and product name set properly. Its installMode and sandboxType are ‘Unknown’, but I am not sure what they are for and whether it has any effects.

The app is able to write into its AppData/LocalLow folder where it is installed currently.

I know that you might get a PlayerPrefsException in case you’re trying to save data that is larger than 1 MB. Not sure this applies to non-web platforms. Also, according to what you’re saying, this happens only when running in non-admin mode, so this may not be your case.

Thank you for the reply.

This is native standalone client and I am writing a dozen of Singles, so I am not anywhere near to 1 MB.

Writing to the registry does not require administrative mode, as it writes to the HKEY_CURRENT_USER and its own company and product subkeys.

I noticed that Windows 8.1 complains that the application is from unverified publisher when I start it. Could that be the case? Do we need to sign the application? Even if it is build by Unity? Can anyone confirm that?

Has anyone found a solution? My game just launched and I’m getting negative reviews bc of this :confused: