26{
28 SCOPE_CYCLE_COUNTER(STATGROUP_AIToolKit_Behaviors);
29 SCOPE_CYCLE_COUNTER(STATGROUP_AIToolKit_Services);
30
31 Super::TickNode(OwnerComp, NodeMemory, DeltaSeconds);
32 FPredictLocationMemory* SelectTargetMemory = reinterpret_cast<FPredictLocationMemory*>(NodeMemory);
33 if(SelectTargetMemory == nullptr){return;}
34 UBlackboardComponent* BlackboardComp = OwnerComp.GetBlackboardComponent();
35 if(BlackboardComp != nullptr)
36 {
37 SelectTargetMemory->TargetActor = Cast<AActor>(BlackboardComp->GetValueAsObject(
TargetActor.SelectedKeyName));
38 }
39 if(SelectTargetMemory->TargetActor == nullptr){return;}
40 if(OwnerComp.GetAIOwner() ==
nullptr && OwnerComp.GetAIOwner()->GetPawn() ==
nullptr){UE_LOG(LogAIToolKit,
Error, TEXT(
"AI Owner NULL in Check Line Of Sight"))return;}
42 if(AIActions != nullptr)
43 {
44 SelectTargetMemory->TargetLocation = AIActions->
PredictLocation(SelectTargetMemory->TargetActor);
46 {
48 }
49 }
50 if(BlackboardComp != nullptr)
51 {
52 BlackboardComp->SetValueAsVector(
TargetLocation.SelectedKeyName, SelectTargetMemory->TargetLocation);
53 }
54}
Definition AIActionsInterface.h:20
virtual FVector PredictLocation(AActor *TargetActor)=0
FColor TargetSphereColor
Definition BTS_PredictLocation.h:45
float SphereLifetime
Definition BTS_PredictLocation.h:43
float SphereSize
Definition BTS_PredictLocation.h:41
virtual void TickNode(UBehaviorTreeComponent &OwnerComp, uint8 *NodeMemory, float DeltaSeconds) override
Definition BTS_PredictLocation.cpp:25