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

  1. Implement WSRF Resettable on the Actor class.
  2. Choose Automatic Then Interface to combine automatic component restoration with gameplay values. Choose Interface Only only when the Blueprint intentionally owns all restoration.
  3. In WSRF Capture Custom State, set a version and write each value with a stable key.
  4. In WSRF Prepare For Reset, stop timers, attacks, interaction, and transient effects.
  5. In WSRF Restore Custom State, branch on Reader version, validate each read, and assign values directly.
  6. 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

Type to search titles, sections and keywords.