Easy Save not generating save file or saving anything or loading anything

Discussion and help for Easy Save 3
Post Reply
mjspritzer
Posts: 25
Joined: Sun Mar 27, 2022 6:22 am

Easy Save not generating save file or saving anything or loading anything

Post by mjspritzer »

Hi,

I have a line of code where I save my high score:

Code: Select all

ES3.Save("HighScore", GameController.instance.scoreSystem.highScore, "/Assets/Saves/SaveFile.es3");
And when It calls this it doesn't save to the file I have created by the same name in the same directory. Even when I do these two instead:

Code: Select all

ES3.Save("HighScore", GameController.instance.scoreSystem.highScore);

Code: Select all

ES3.Save("HighScore", GameController.instance.scoreSystem.highScore, "Assets/Saves/SaveFile.es3");
It just doesn't save anywhere. When I type in "SaveFile" in the search function in the unity project, nothing comes up.

I created the file, and nothing saves inside of it when viewing in notepad.

Then, when attempting to load, nothing happens either, because nothing saved.

Please help!
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Easy Save not generating save file or saving anything or loading anything

Post by Joel »

Hi there,

The default Save location is relative to Unity’s Application.persistentDataPath (https://docs.unity3d.com/ScriptReferenc ... aPath.html) as this is the only place guaranteed to be writable at runtime. You can open this folder by going to Tools > Easy Save 3 > Open PersistentDataPath.

If you want to write in your project folder you should create your own absolute path using Application.dataPath (https://docs.unity3d.com/ScriptReferenc ... aPath.html) and provide this instead, but be aware that this doesn’t exist at runtime on most platforms.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply