Navigation
API > API/Runtime > API/Runtime/AIModule
Play indicated AnimationAsset on Pawn controlled by BT Note that this node is generic and is handing multiple special cases, If you want a more efficient solution you'll need to implement it yourself (or wait for our BTTask_PlayCharacterAnimation)
| Name | UBTTask_PlayAnimation |
| Type | class |
| Header File | /Engine/Source/Runtime/AIModule/Classes/BehaviorTree/Tasks/BTTask_PlayAnimation.h |
| Include Path | #include "BehaviorTree/Tasks/BTTask_PlayAnimation.h" |
Syntax
UCLASS (MinimalAPI)
class UBTTask_PlayAnimation : public UBTTaskNode
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UBTNode → UBTTaskNode → UBTTask_PlayAnimation
Implements Interfaces
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UBTTask_PlayAnimation
(
const FObjectInitializer& ObjectInitializer |
BehaviorTree/Tasks/BTTask_PlayAnimation.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AnimationToPlay | FValueOrBBKey_Object | Animation asset to play. Note that it needs to match the skeleton of pawn this BT is controlling | BehaviorTree/Tasks/BTTask_PlayAnimation.h |
|
| bLooping | FValueOrBBKey_Bool | BehaviorTree/Tasks/BTTask_PlayAnimation.h |
|
|
| bNonBlocking | FValueOrBBKey_Bool | If true the task will just trigger the animation and instantly finish. Fire and Forget. | BehaviorTree/Tasks/BTTask_PlayAnimation.h |
|
| CachedSkelMesh | TObjectPtr< USkeletalMeshComponent > | BehaviorTree/Tasks/BTTask_PlayAnimation.h | ||
| MyOwnerComp | TObjectPtr< UBehaviorTreeComponent > | BehaviorTree/Tasks/BTTask_PlayAnimation.h | ||
| PreviousAnimationMode | EAnimationMode::Type | BehaviorTree/Tasks/BTTask_PlayAnimation.h | ||
| TimerDelegate | FTimerDelegate | BehaviorTree/Tasks/BTTask_PlayAnimation.h | ||
| TimerHandle | FTimerHandle | BehaviorTree/Tasks/BTTask_PlayAnimation.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void OnAnimationTimerDone() |
BehaviorTree/Tasks/BTTask_PlayAnimation.h |
Overridden from UBTTaskNode
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual EBTNodeResult::Type AbortTask
(
UBehaviorTreeComponent& OwnerComp, |
Aborts this task, should return Aborted or InProgress (use FinishLatentAbort() when returning InProgress) this function should be considered as const (don't modify state of object) if node is not instanced! | BehaviorTree/Tasks/BTTask_PlayAnimation.h | |
virtual EBTNodeResult::Type ExecuteTask
(
UBehaviorTreeComponent& OwnerComp, |
Starts this task, should return Succeeded, Failed or InProgress (use FinishLatentTask() when returning InProgress) this function should be considered as const (don't modify state of object) if node is not instanced! | BehaviorTree/Tasks/BTTask_PlayAnimation.h |
Overridden from UBTNode
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FName GetNodeIconName() |
Get the name of the icon used to display this node in the editor | BehaviorTree/Tasks/BTTask_PlayAnimation.h | |
virtual FString GetStaticDescription() |
BehaviorTree/Tasks/BTTask_PlayAnimation.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void CleanUp
(
UBehaviorTreeComponent& OwnerComp |
BehaviorTree/Tasks/BTTask_PlayAnimation.h |