PlayerPrefs data not saving in Linux centos

Started by
3 comments, last by Alberth 5 years ago

Hi All, I am trying to save data in PlayerPrefs in Unity which is installed in Linux centos 7. But whenever I restart the editor the playerprefs data is not saved. So, How can I save PlayerPrefs data in Unity with Centos ?

Advertisement

Open a file for writing, write the data you want to save, and close the file again.

 

Obviously, it matters how / where you installed it, how you started it (which user), and where you try to open the file. It may also be useful to actually check return values of operating system calls, they tend to give very good hints what is wrong.

Random guess, you try to write a file in /usr/<somewhere> as normal user. That won't fly in any sanely configured Unix system.

From:https://docs.unity3d.com/ScriptReference/PlayerPrefs.html
On Linux, PlayerPrefs can be found in ~/.config/unity3d/[CompanyName]/[ProductName] again using the company and product names specified in the Project Settings.
 

Could you make sure, that the user, that's running the editor, has a home and is allowed to write in it?

Home directory normally exists and is writable (since it's where you store all your files), so perhaps one of the directories doesn't exist? You cannot write a file in a non-existing directory.

 

BTW: Centos is a pretty bad choice for a game platform. It's a server distribution, so typical computer running that is sitting in a 42" rack in a server room without monitor, keyboard, and mouse.

Unless you aim to have sys admins play in the server room, of course :)

This topic is closed to new replies.

Advertisement