Jump to content
  • Advertisement
Gautti

C# PlayerPrefs data not saving in Linux centos

Recommended Posts

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 ?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Posted (edited)

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?

Edited by GWDev

Share this post


Link to post
Share on other sites
Posted (edited)

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 :)

Edited by Alberth

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!