Saving data to local Device

HI,
I’m trying to save my player data script using untiy Persistence tutorial, but i found out that i cant serialize GameObjects or ScriptableObjects…

is there a way to do that?

Thank you!

Hi @FakeBocha

The simple answer is you simply can’t with built in tools. (edit: meaning, in simple manner. You could code any kind of serialization system yourself for your specific needs)

I think you understand the issue better, if you first read about and figure out what serialization actually means.

There was just today a good thread on the forums about the topic.

See lordofduct’s answer: https://forum.unity.com/threads/terminology-what-does-serializable-mean-in-unity-terms.546241/

Also, read about different serialization methods - Json, Binary and XML serialization. These are pretty generic and not unity specific. Unity editor too has it’s own serialization for editor/inspector stuff.

Also, if you are saving player data, you just need to save (serialize/deserialize) your player data only.