diff --git a/Source/UnrealHelperLibrary/Private/AI/Tasks/BTT_PlayAnimMontage.cpp b/Source/UnrealHelperLibrary/Private/AI/Tasks/BTT_PlayAnimMontage.cpp index 9d53a6d..69b5128 100644 --- a/Source/UnrealHelperLibrary/Private/AI/Tasks/BTT_PlayAnimMontage.cpp +++ b/Source/UnrealHelperLibrary/Private/AI/Tasks/BTT_PlayAnimMontage.cpp @@ -20,11 +20,11 @@ EBTNodeResult::Type UBTT_PlayAnimMontage::ExecuteTask(UBehaviorTreeComponent& Ow { EBTNodeResult::Type Result = EBTNodeResult::Failed; + bIsAborting = false; FUHLPlayAnimMontageMemory* MyMemory = CastInstanceNodeMemory(NodeMemory); - - AIOwner = OwnerComp.GetAIOwner(); + AAIController* AIOwner = OwnerComp.GetAIOwner(); OwnerComponent = &OwnerComp; - if (!AIOwner.Get()) + if (!AIOwner) { Result = EBTNodeResult::Failed; return Result; diff --git a/Source/UnrealHelperLibrary/Public/AI/Services/BTS_GameplayFocus.h b/Source/UnrealHelperLibrary/Public/AI/Services/BTS_GameplayFocus.h index 6b3b652..6f46d2b 100644 --- a/Source/UnrealHelperLibrary/Public/AI/Services/BTS_GameplayFocus.h +++ b/Source/UnrealHelperLibrary/Public/AI/Services/BTS_GameplayFocus.h @@ -3,6 +3,7 @@ #pragma once #include "CoreMinimal.h" +#include "Misc/EngineVersionComparison.h" #include "BehaviorTree/Services/BTService_DefaultFocus.h" #include "BTS_GameplayFocus.generated.h" diff --git a/Source/UnrealHelperLibrary/Public/AI/Tasks/BTT_PlayAnimMontage.h b/Source/UnrealHelperLibrary/Public/AI/Tasks/BTT_PlayAnimMontage.h index 686d783..e6eb536 100644 --- a/Source/UnrealHelperLibrary/Public/AI/Tasks/BTT_PlayAnimMontage.h +++ b/Source/UnrealHelperLibrary/Public/AI/Tasks/BTT_PlayAnimMontage.h @@ -49,9 +49,7 @@ class UNREALHELPERLIBRARY_API UBTT_PlayAnimMontage : public UBTTaskNode private: bool bIsAborting = false; TWeakObjectPtr Character; - /** Cached AIController owner of BehaviorTreeComponent. */ - UPROPERTY(Transient) - TObjectPtr AIOwner; + UPROPERTY() TObjectPtr OwnerComponent;