Skip to content
Patrick Hardy edited this page Jul 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.

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.

Navigation

Clone this wiki locally