Save and (later) read scriptable objects

Hey everyone,

So in my game I currently have a system that creates a bunch of npc stat containers by using “create instance” of a new scriptable object, setting the variables inside to randomized values, and then adding this new SO to a list. This list can contain anywhere between 8 - 16 scriptable objects.

I have been trying to find some documentation about how I can save these new scriptable objects, as they are meant to be generated at runtime and will need to be called between different play sessions but I cant find any helpful information. If anyone knows anything about saving a list of scriptable objects, and later reading the list from file, I would really appreciate your help :slight_smile:

Thanks for taking the time to read my questions either way !

Hey there,

I’m not sure if i understand what your “scriptable object” is supposed to be but either way saving to JSON format mostly works out fine.

You can find a basic reference on how to do that HERE.

It basically transforms a Serializable object into a string based dictionary which can by saved to a file.
Hope this helps!