Navigation
API > API/Plugins > API/Plugins/GameplayStateTreeModule > API/Plugins/GameplayStateTreeModule/Components
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- UBrainComponent
- UStateTreeComponent
References
| Module | GameplayStateTreeModule |
| Header | /Engine/Plugins/Runtime/GameplayStateTree/Source/GameplayStateTreeModule/Public/Components/StateTreeComponent.h |
| Include | #include "Components/StateTreeComponent.h" |
Syntax
UCLASS&40;ClassGroup&61;AI, HideCategories&61;&40;Activation, Collision&41;, Meta&61;&40;BlueprintSpawnableComponent&41;&41;
class UStateTreeComponent :
public UBrainComponent,
public IGameplayTaskOwnerInterface
Variables
| Type | Name | Description | |
|---|---|---|---|
| uint8: 1 | bIsPaused | If set, execution requests will be postponed | |
| uint8: 1 | bIsRunning | If set, state tree execution is allowed | |
| bool | bStartLogicAutomatically | If true, the StateTree logic is started on begin play. | |
| FStateTreeInstanceData | InstanceData | ||
| FStateTreeRunStatusChanged | OnStateTreeRunStatusChanged | Called when the run status of the StateTree has changed | |
| FStateTreeReference | StateTreeRef |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UStateTreeComponent
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| EStateTreeRunStatus | Returns the current run status of the StateTree. | ||
| void | SendStateTreeEvent
(
const FStateTreeEvent& Event |
Sends event to the running StateTree. | |
| void | SendStateTreeEvent
(
const FGameplayTag Tag, |
Sends event to the running StateTree. | |
| bool | SetContextRequirements
(
FStateTreeExecutionContext& Context, |
||
| void | SetStartLogicAutomatically
(
const bool bInStartLogicAutomatically |
Sets whether the State Tree is started automatically on being play. |
Overridden from UBrainComponent
| Type | Name | Description | |
|---|---|---|---|
| void | Cleanup () |
AI logic won't be needed anymore, stop all activity and run cleanup | |
| bool | IsPaused () |
||
| bool | IsRunning () |
||
| void | PauseLogic
(
const FString& Reason |
Pause logic and blackboard updates. | |
| void | RestartLogic () |
Restarts currently running or previously ran brain logic. | |
| EAILogicResuming::Type | ResumeLogic
(
const FString& Reason |
Resumes paused brain logic. MUST be called by child implementations! | |
| void | StartLogic () |
Starts brain logic. If brain is already running, will not do anything. | |
| void | Stops currently running brain logic. |
Overridden from UActorComponent
| Type | Name | Description | |
|---|---|---|---|
| void | BeginPlay () |
Begins Play for the component. | |
| void | EndPlay
(
const EEndPlayReason::Type EndPlayReason |
Ends gameplay for this component. | |
| void | BEGIN UActorComponent overrides | ||
| void | TickComponent
(
float DeltaTime, |
Function called every frame on this ActorComponent. | |
| void | Handle this component being Uninitialized. |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. |
Overridden from IGameplayTaskOwnerInterface
| Type | Name | Description | |
|---|---|---|---|
| AActor * | GetGameplayTaskAvatar
(
const UGameplayTask* Task |
Get "body" of task's owner / default, having location in world (e.g. Owner = AIController, Avatar = Pawn) | |
| uint8 | Get default priority for running a task | ||
| AActor * | GetGameplayTaskOwner
(
const UGameplayTask* Task |
Get owner of a task or default one when task is null | |
| UGameplayTasksComponent * | GetGameplayTasksComponent
(
const UGameplayTask& Task |
Finds tasks component for given GameplayTask, Task.GetGameplayTasksComponent() may not be initialized at this point! | |
| void | OnGameplayTaskInitialized
(
UGameplayTask& Task |
Notify called after GameplayTask finishes initialization (not active yet) |
Deprecated Variables
| Type | Name | Description | |
|---|---|---|---|
| TObjectPtr< UStateTree > | StateTree_DEPRECATED | This property has been deprecated. Use StateTreeReference instead. |