5-minute quick start
Install the package, create the settings asset, add the Persistence Save component and press Play. No code required.
The shortest path to a working save#
This page assumes the package is installed. If it is not, Installation takes two minutes.
- Create the settings asset. NexusForge → Persistence → Setup → Create settings asset, then press Apply to the settings asset with the Minimal preset. Minimal turns on local storage with integrity and a retained backup, and leaves autosave, encryption and cloud off.
- Start the framework once at game start. Either call it in code, or drive it from the settings asset: ```csharp using NexusForge.Persistence.Unity;
NexusForgePersistence.Initialize(PersistenceOptions.CreateDefault("com.yourstudio.yourgame")); ```
- Add the component. Select the GameObject whose state matters — the player, a save manager, a scene controller — and add NexusForge → Persistence Save from Add Component.
- Assign what to save. Drag GameObjects, components or
PersistableScriptableObjectassets into What to save. The Inspector tells you immediately if something in there cannot be persisted. - Leave the triggers alone. The defaults save on disable/destroy and on pause or background, which covers desktop and mobile without further decisions.
- Press Play. The object is captured, written and versioned. The Inspector's validation panel stays green, and the Save Browser shows the slot.
No code was written, and nothing was taken away: the component is a client of the same SaveSlotService you can call yourself.
With one line of code instead#
using NexusForge.Persistence.Unity;
await NexusForgePersistence.Save(class="tok-str">"player", playerData);
var loaded = await NexusForgePersistence.Load<PlayerData>(class="tok-str">"player");
if (loaded.IsSuccess && loaded.Value.Loaded)
{
ApplyToGame(loaded.Value.Data);
}Save(data) writes the default slot at schema version 1. Both calls return a PersistenceResult, so a full disk is a value the game can show the player rather than an exception thrown in a frame.
Verify what you just did#
Press Run smoke test in the same window. It writes and reads a small model through the real pipeline and reports the bytes written, the path used and how long it took. It proves the wiring, not your model's contract — see Recovery for what happens when a real save is damaged.
Where to go next#
| You want to | Read |
|---|---|
| Understand the component's decisions | No-code save component |
| Save your own model in code | Your first save |
| Handle "there is no save yet" correctly | Your first load |
| Multiple save files, profiles or game states | Save slots |
| Nothing at all: save automatically | Autosave |
Something wrong on this page? Every page here describes behaviour that is checked in the repository. If a page and the package disagree, the package wins.
Report a documentation problem · Frequently asked questions · Troubleshooting