diff --git a/Source/Nakatomi/Tasks/BTTClearFocus.cpp b/Source/Nakatomi/Tasks/BTTClearFocus.cpp index 0cec164..19a75c2 100644 --- a/Source/Nakatomi/Tasks/BTTClearFocus.cpp +++ b/Source/Nakatomi/Tasks/BTTClearFocus.cpp @@ -1,5 +1,14 @@ // Fill out your copyright notice in the Description page of Project Settings. -#include "Tasks/BTTClearFocus.h" +#include "../Tasks/BTTClearFocus.h" +#include "Nakatomi/EnemyAIController.h" + +EBTNodeResult::Type UBTTClearFocus::ExecuteTask(UBehaviorTreeComponent& owner, uint8* memory) +{ + auto enemyController = Cast(owner.GetAIOwner()); + enemyController->ClearFocus(EAIFocusPriority::Default); + enemyController->SetFocus(); + return EBTNodeResult::Succeeded; +} diff --git a/Source/Nakatomi/Tasks/BTTClearFocus.h b/Source/Nakatomi/Tasks/BTTClearFocus.h index 7e7e552..513bf29 100644 --- a/Source/Nakatomi/Tasks/BTTClearFocus.h +++ b/Source/Nakatomi/Tasks/BTTClearFocus.h @@ -13,5 +13,8 @@ UCLASS() class NAKATOMI_API UBTTClearFocus : public UBTTaskNode { GENERATED_BODY() + +public: + virtual EBTNodeResult::Type ExecuteTask(UBehaviorTreeComponent& owner, uint8* memory) override; };