-
Notifications
You must be signed in to change notification settings - Fork 0
Step 02: Saving Your First Actor
Three steps: add the component, mark the variables, call save.
Open your actor Blueprint and add a Saveable Component (search "Saveable" in the Add Component menu). That is all an actor needs to be part of every save.
Select a variable, open the Details panel and tick Save Game. Only variables with this flag are saved - everything else is ignored. This works on the actor itself and on any of its components.
Supported types: int, float, bool, string, name, text, vector, rotator, transform, enums, structs (including nested), arrays, maps, sets, object and soft object references.
Call Save Game and Load Game from anywhere in Blueprint (they are in the "Ultimate Save System" category). Both take a slot name - any string you like.
That is the whole setup. On load, the actor's transform, its SaveGame variables and its saved components are restored. Runtime-spawned actors are respawned automatically, and actors you destroyed stay destroyed.
- The actor's world transform (optional, on by default)
- Every SaveGame variable on the actor
- Every SaveGame variable on its components (see policy in Step 03)
- Component transforms - including physics-simulated meshes, restored in world space
- ISM / HISM / foliage per-instance transforms
- Whether the actor was destroyed (tombstone)
Implement the USS Saveable interface on the actor to receive events:
- On Pre Save - fires right before capture (flush transient state into SaveGame vars here)
- On Saved - fires right after capture
- On Loaded - fires after the actor's state has been restored (update visuals here)
Next: Step 03: Saveable Component