Skip to content

Instantiation and Context

Patrick Hardy edited this page Feb 8, 2019 · 4 revisions

Design-Time

When designing a State Machine Blueprint you can reference the object the State Machine represents by calling Get Context in any graph and casting it to your object type.

Think of this as being similar to Try Get Pawn Owner of Animation Blueprints.

Run-Time

UObjects

You can create the State Machine any where by calling the static function "Create State Machine Instance". When you do so you must pass in both the class of the State Machine and the Context.

Blueprint

C++

Actor Components

State Machine Components are wrappers for UObjects which also support Network Replication. By default the actor itself is passed in as the Context to the State Machine.

Blueprint

If you uncheck "Initialize on Begin Play" make sure to call Initialize on the actor component before starting it.

You can’t perform that action at this time.