PlayerPrefs Set is freezing Unity

Hi,

Anytime I call PlayerPrefs.SetString or PlayerPrefs.SetInt and then hit the Play button to restart my application within Unity, Unity freezes with a spinning beachball. This problem has been happening ever since I installed Unity ~1.5 years ago. I’m running the latest version of Unity on the latest Mac OS X.

I do have a “~/Library/Preferences/unity.[company name].[project name].plist” file, but it is called “~/Library/Preferences/unity.my.email@gmail.com.UnityProject.plist”. Where “my.email” is my actual email address name. My project name is not “UnityProject”, if that helps.

For now, I make sure that I do not save anything while in the Unity Editor. Everything works fine when run from my iPhone.

All it takes is just 1 PlayerPrefs.Set* call. There is nothing fancy about the way it is called.

Any ideas?

Thanks!

I found that there was only one PlayerPrefs file for Unity early on, so if I had multiple projects they would load each other’s plist data. (I haven’t checked the confirm this with U3).

I’m guessing you’ve tried to write the Int with a different name in case its conflicting with something else? Not doing it in an update loop or something?

Yes, that is correct. Different names and calling it in a different location all has the same effect. It is good to know that there is only one file for multiple projects. I was wondering why I didn’t have a separate file for each project. Maybe U3 will fix the problem.