Space Plunder
Loading...
Searching...
No Matches
UBTTask_Aim Class Reference

#include <BTTask_Aim.h>

Inheritance diagram for UBTTask_Aim:

Public Member Functions

 UBTTask_Aim ()
 

Public Attributes

bool bStartAiming = true
 

Protected Member Functions

virtual EBTNodeResult::Type ExecuteTask (UBehaviorTreeComponent &OwnerComp, uint8 *NodeMemory) override
 
virtual FString GetStaticDescription () const override
 

Detailed Description

UBTTask_Aim class is a behavior tree task node that aims at a target.

This task aims at a target and can be used in an AI controlled character's behavior tree. It provides the ability to toggle the aiming on or off using the bStartAiming property. The ExecuteTask function performs the aiming logic, while the GetStaticDescription function returns a description of the task. The GetNodeIconName function returns the name of the icon to be displayed for this task.

Constructor & Destructor Documentation

◆ UBTTask_Aim()

UBTTask_Aim::UBTTask_Aim ( )
14{
15 NodeName = TEXT("Aim");
16}

Member Function Documentation

◆ ExecuteTask()

EBTNodeResult::Type UBTTask_Aim::ExecuteTask ( UBehaviorTreeComponent & OwnerComp,
uint8 * NodeMemory )
overrideprotectedvirtual
19{
20 TRACE_CPUPROFILER_EVENT_SCOPE(UBTTask_Aim::ExecuteTask);
21 SCOPE_CYCLE_COUNTER(STATGROUP_AIToolKit_Behaviors);
22 SCOPE_CYCLE_COUNTER(STATGROUP_AIToolKit_Tasks);
23
24 IAIActionsInterface* AIActions = Cast<IAIActionsInterface>(OwnerComp.GetAIOwner());
25 if(AIActions != nullptr)
26 {
27 AIActions->Aim(bStartAiming);
28 return EBTNodeResult::Succeeded;
29 }
30 return EBTNodeResult::Failed;
31}
Definition AIActionsInterface.h:20
virtual void Aim(const bool bStartAiming=true)=0
bool bStartAiming
Definition BTTask_Aim.h:25
virtual EBTNodeResult::Type ExecuteTask(UBehaviorTreeComponent &OwnerComp, uint8 *NodeMemory) override
Definition BTTask_Aim.cpp:18

◆ GetStaticDescription()

FString UBTTask_Aim::GetStaticDescription ( ) const
overrideprotectedvirtual
34{
35 FString Description;
36 if(!bStartAiming)
37 {
38 Description += FString::Printf(TEXT("\nStop Aiming"));
39 }
40 return Description;
41}

Member Data Documentation

◆ bStartAiming

bool UBTTask_Aim::bStartAiming = true

The documentation for this class was generated from the following files: