Navigation
API > API/Plugins > API/Plugins/StateTreeModule > API/Plugins/StateTreeModule/FStateTreeExecutionContext
Description
Runs state selection logic starting at the specified state, walking towards the leaf states. If a state cannot be selected, false is returned. If NextState is a selector state, SelectStateInternal is called recursively (depth-first) to all child states (where NextState will be one of child states). If NextState is a leaf state, the active states leading from root to the leaf are returned.
| Name | SelectState |
| Type | function |
| Header File | /Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/StateTreeExecutionContext.h |
| Include Path | #include "StateTreeExecutionContext.h" |
| Source | /Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Private/StateTreeExecutionContext.cpp |
bool SelectState
(
const FStateTreeExecutionFrame & CurrentFrame,
const FStateTreeStateHandle NextState,
FStateSelectionResult & OutSelectionResult,
const FStateTreeSharedEvent * TransitionEvent,
const EStateTreeSelectionFallback Fallback
)
True if succeeded to select new active states.
Parameters
| Name | Remarks |
|---|---|
| CurrentFrame | The frame where the NextState is valid. |
| NextState | The state which we try to select next. |
| OutSelectionResult | The result of selection. |
| TransitionEvent | Event used by transition to trigger the state selection. |
| Fallback | selection behavior to execute if it fails to select the desired state |