Save data to file - Android

Hello, i want to make save to file because PlayerPrefs gonna be not so optimal with that data size. I wrote this script:

But i have errors:
save:
IOException: Sharing violation on path C:\Users\Jason\AppData\LocalLow\TC\SurvivalGame\playerInfo.dat
NullReferenceException: Object reference not set to an instance of an object

load:
SerializationException: serializationStream supports seeking, but its length is 0

Please help! :frowning:

The error on LoadGame() is only because the file couldn’t be saved, so it doesn’t have anything to load.

Now, about the save method, maybe the file is open in your Unity due to a previour error. I would suggest you to close and open Unity Editor, delete the playerInfo.dat (if it exists at all) and then trying again.