Use Custom State
Store gameplay meaning — health, AI mode, puzzle state, relationships — in the versioned Custom State channel, and follow the safe rules.
Use Custom State for gameplay meaning: health, AI mode, inventory, progression, combat, puzzle state, charges, loot decisions, and relationships.
Setup
- Implement WSRF Resettable on the Actor class.
- Choose Automatic Then Interface to combine automatic component restoration with gameplay values. Choose Interface Only only when the Blueprint intentionally owns all restoration.
- In WSRF Capture Custom State, set a version and write each value with a stable key.
- In WSRF Prepare For Reset, stop timers, attacks, interaction, and transient effects.
- In WSRF Restore Custom State, branch on Reader version, validate each read, and assign values directly.
- In WSRF Reset Completed, restart behavior after the Actor’s complete state is ready.
Safe rules
- Do not store Actor or component references. Store WSRF Stable IDs and handle null when resolving.
- Do not replay irreversible gameplay events merely to reconstruct values.
- Increment the Custom State version when key meaning changes and keep explicit old-version defaults/migration.
- Do not retain Writer or Reader objects after the callback.
- Keep large inventories or procedural data in a compact project-owned save representation; WSRF Custom State is deliberately typed and bounded.
See Custom state and dependencies for supported types and a complete health example.
Last updated: 2026-09-04