Hi,
My AI keeps the focus towards the FP player, but does not aim up. The only thing that i’ve done differently is that i created the task in C++ instead of blueprints. Here is the code
EBTNodeResult::Type UFaceActor::ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) {
UBlackboardComponent* blackBoard = OwnerComp.GetBlackboardComponent();
/*
FVector focus = blackBoard->GetValueAsVector(EnemyKey.SelectedKeyName);
if (focus.ContainsNaN()) {
UE_LOG(LogClass, Warning, TEXT("Focus Failed"));
return EBTNodeResult::Failed;
}
*/
AActor* focusActor = Cast<AActor>(blackBoard->GetValueAsObject(EnemyKey.SelectedKeyName));
if (!ensure(focusActor)) {
UE_LOG(LogClass, Warning, TEXT("Focus Actor not found"));
}
//OwnerComp.GetAIOwner()->SetFocalPoint(focus);
OwnerComp.GetAIOwner()->SetFocus(focusActor);
return EBTNodeResult::Succeeded;
}
I’ve commented out the SetFocusPoint part, changed the key in the blackboard to an Object and everything works, except the AI does not AIM up.
UE Version: 4.15
Will appreciate any hints or tips…thanks