Skip to content
Patrick Hardy edited this page Oct 31, 2019 · 8 revisions

States have three main types: States, State Machines, and Conduits.

State

Contains Begin, Update, and End entry points.

On State Begin:

Once a state is entered the Begin logic will execute and will not execute again unless the state is re-entered.

On State Update:

This occurs every tick the state is active and the Delta Seconds from the last tick is passed in. If you disable tick and manage state updates on your own it is your responsibility for passing in the Delta Seconds.

On State End:

Always occurs when a state ends. This will trigger before any Transition Entered logic plays or the next state starts.

State Machine

It is possible to nest State Machines as many times as you want. Priority is given to the super state so you may want to have transitions leading out of the nested State Machine wait for its completion. There is a helper blueprint node: Has State Machine Reached End State which is perfect for this, but requires the nested State Machine have an end state.

Hierarchical Example

Super State Machine A changes states to sub State Machine B. Once sub B becomes active it will start the first state of sub B. On the next tick super A transitions are evaluated first. If a transition out is active it will then call On End on sub B triggering On End of the nested state.

State Machine References

You can reference other State Machine blueprints to allow for re-usability. They function the same as nested state machines.

  • The context of the super State Machine will be passed into the reference automatically.
  • The reference will inherit the super State Machine's replication settings.
  • The system attempts to catch circular referencing, but ultimately it is up to you to make sure you don't run into an infinite loop.

Intermediate Graphs

State machine references can optionally have an intermediate graph. This allows you to hook into entry points for when the reference starts, updates, or ends.

  • The context of the reference can be changed.
  • An optional node Get State Machine Reference is available in this graph.
    • Reference variables can be read or set from here.
  • An optional entry point On State Machine Start is available for initializing properties.
    • This fires when the root state machine of the blueprint owning the reference starts.

Conduits

Conduits only consist of a boolean operation which must be true before any outgoing transitions are evaluated.

Properties

Clicking on a state will let you configure any properties of that state.

Always Update

  • Ensures that the On Update method is always called at least once before exiting a state. Without this it is possible the update method may not be called in the scenario where a state starts and then on the next tick it completes.

Reuse Current State (State Machines)

  • When true the current state is reused when the state machine exits and restarts.
  • When false the current state is cleared on end and the initial state used on start.
  • References will inherit this behavior.

Reuse if Not End State (Requires ReuseCurrentState)

  • Do not reuse if in an end state.
  • References will inherit this behavior.

Allow Independent Tick (References)

  • Allows the state machine reference to tick on its own.

Call Tick on Manual Update (References)

  • The Update method will call Tick only if Update was not called by native Tick.