Skip to content

Getting Started

Patrick Hardy edited this page Jan 30, 2019 · 6 revisions

Creating a new state machine is simple: right click on the content browser, choose Blueprints, then State Machine. Open the asset and begin designing your State Machine.

The Get Context node allows you to retrieve the context this State Machine is running for. This is what gets passed into the State Machine when it starts.

When you are ready to use your State Machine you can decide the best way to instantiate it. The easiest way is adding an ActorComponent to your actor. By default this will create the State Machine instance on BeginPlay and pass in this Actor as the context. Actor components also support Network Replication out of the box.

If that doesn’t work for you, another option is adding a variable in a Blueprint of your choice as a StateMachineInstance type. Then call CreateStateMachineInstance and manually pass in a context during run-time.

Finally, call Start on the State Machine instance when you want it to begin processing. This will set the state to the initial state and begin running state logic and checking transitions.

Navigation

Clone this wiki locally