Compare commits

...

1 Commits

Author SHA1 Message Date
baz 03d5b80a0b Create Clear Focus Task 2024-02-08 18:30:39 +00:00
2 changed files with 13 additions and 1 deletions

View File

@ -1,5 +1,14 @@
// Fill out your copyright notice in the Description page of Project Settings. // 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<AEnemyAIController>(owner.GetAIOwner());
enemyController->ClearFocus(EAIFocusPriority::Default);
enemyController->SetFocus();
return EBTNodeResult::Succeeded;
}

View File

@ -14,4 +14,7 @@ class NAKATOMI_API UBTTClearFocus : public UBTTaskNode
{ {
GENERATED_BODY() GENERATED_BODY()
public:
virtual EBTNodeResult::Type ExecuteTask(UBehaviorTreeComponent& owner, uint8* memory) override;
}; };