The short version

A ScriptableObject is a Unity object that holds data and lives as an asset file in your project, instead of being attached to a GameObject in a scene. Think of it as a container for data that you can create, name, and edit in the inspector like any other asset.

It is perfect for things like player stats, game settings, an inventory definition, or a difficulty curve: data you want to author in the editor and read from anywhere in your game.

vs. MonoBehaviour

If you have written Unity scripts before, you know MonoBehaviour: the script you attach to a GameObject. A ScriptableObject is its sibling for pure data.

  • MonoBehaviour lives on a GameObject, inside a scene or prefab. It has Update, Start, a transform, and so on.
  • ScriptableObject lives as a standalone .asset file in your Project window. No GameObject, no scene, no per-frame loop. Just fields.

Because a ScriptableObject is a single shared asset, every script that references it sees the same data. Change it in one place and everyone reading it sees the change, with no copies to keep in sync.

Making one

Three small steps, all standard Unity:

  1. Write a class that inherits ScriptableObject.
  2. Add [CreateAssetMenu] so it shows up in the Create menu.
  3. Right-click in the Project window and create an instance. Its fields appear in the inspector, ready to edit.
using UnityEngine;

[CreateAssetMenu(menuName = "Player Data")]
public class PlayerData : ScriptableObject
{
    public int gold;
    public int level = 1;
}

That is a plain ScriptableObject. You will notice it looks almost identical to the Persistent Asset example: the only difference is which class you inherit.

The catch (and where Persistent Asset comes in)

ScriptableObjects are great for authoring data, but they were never meant to save it. In a built game, any change made while playing lives in memory only and is gone the moment the game closes. Your authored values load fresh every launch; the player's progress does not stick.

In the editor it looks like changes persist, because Unity writes runtime edits back into the asset on disk. That is an editor-only quirk, and it does not happen in a real build. It is a classic source of confusion.

That missing piece, saving and restoring the data between sessions, is exactly what Persistent Asset adds. You inherit PersistentScriptableObject instead of ScriptableObject, and the saving happens for you.