Can scriptable objects save data or not?

I recently read this article Architect your code for efficient changes and debugging with ScriptableObjects | Unity
and have been trying to implement the principles outlined, trying to use scriptable objects wherever possible instead of monobehaviors and definitely no singletons.
The first system I have tried it on is a simple inventory system. The player Inventory is a scriptable object that contains an array of Inventory Slot structs which just contain the item id and quantity.
Everything is going great and I can move between scenes with my inventory intact, no extra code or anything. Fantastic. However, I mentioned I was doing this to someone else and they threw a spanner in the works.
Unity - Manual: ScriptableObject

This page clearly states that what I’m doing wont work in a build. It says " In a deployed build, however, you can’t use ScriptableObjects to save data, but you can use the saved data from the ScriptableObject Assets that you set up during development."

Of course I did a build and run and it worked perfectly but now I’m concerned I’m going down an incorrect route and its going to not work in the future or on a different computer/platform.

The article you read is based on Ryan Hipples Unite 2017 talk. I can really recommend watching the whole talk. As several points he actually mentions Richard Fines talk from 2016, which is also worth watching, even though both cover similar topics, you get slightly different aspects from each talk.

Note that the documentation page you’ve linked is kinda outdated. I’m sure the line you mentioned comes from the time before the JsonUtility even existed. Before we has the JsonUtility there was no direct way to save / serialize scriptableObjects.

Though the question is what you understand by “saving data”. Scriptable objects are mainly used as assets in a project that can be referenced by other assets in the project. Such scriptable objects are serialized into your project. Those serialized assets can not be modified permanentally. Of course just like all classes in memory you can change the data it contains, however those changes would be reverted when you restart your game as scriptable object are serialized into the asset database and such assets can not be changed at runtime. Note that when testing in the editor, that’s a different case as you test inside the development environment. At runtime you could save ScriptableObjects with the JsonUtility to a json string / file which you can reload when you restart your game.

I haven’t used a lot of scriptable objects, from what i get they are mostly reusable data structures.

Are you aware that instead of Mono or scriptables, you can simply use plain old c# classes?

the scriptable object setup is great but you are not alone, I’ve wrongly assumed that I can used them to save stuff at runtime. Got this impression because while the editor was open they behave like a data container, everithing changed during various editor play and stop sessions remained saved. But, once I’ve closed the editor and reopened, all changes vanished.

So in short if you need them to have them keep different values between player play session, you need to save the changes with some other method, then when the game is open, you need to retrive these changes and replace the default values.

Bunny83 is pretty much on point