Skip to content

Saving and Restoring States

Patrick Hardy edited this page Dec 5, 2019 · 1 revision

Saving Active State

  • The guid of the active state can be easily retrieved for serialization by using GetNestedActiveStateGuid from the state machine instance.

Loading Active State

  • Use LoadFromState from the state machine instance and provide the guid of the active state.
  • The state machine will automatically set initial states of all affected state machines.

Saving and Restoring All States

  • If the current state of a nested state machine which doesn't contain the active state is important use GetAllCurrentStateGuids and LoadFromMultipleStates from the state machine instance.
    • Normally nested state machines clear their state on exit. You may use bReuseCurrentState and bReuseIfNotEndState on state machine nodes to change this behavior.

General Serialization

  • If you need to save variables you've added to the state machine blueprint you will need to implement your own serializer for this as you would with any other Blueprint.