// Fill out your copyright notice in the Description page of Project Settings.
#include “Stealth.h”
#include “APatrolIController.h”
#include “AIPatrol.h”
#include “AIPatrolPoints.h”
#include “BehaviorTree/BlackboardComponent.h”
#include “BehaviorTree/BehaviorTreeComponent.h”
#include “BehaviorTree/BehaviorTree.h”
AAPatrolIController::AAPatrolIController()
{
BehaviorComp = CreateDefaultSubobject<UBehaviorTreeComponent>(TEXT("BehaviorComp"));
BlackboardComp = CreateDefaultSubobject<UBlackboardComponent>(TEXT("BlackboardComp"));
PlayerKey = "Target";
LocationToGoKey = "LocationToGoKey";
}
void AAPatrolIController::Possess(APawn * Pawn)
{
Super::Possess(Pawn);
AAIPatrol* AICharacter = Cast<AAIPatrol>(Pawn);
if (AICharacter)
{
if (AICharacter->BehaviorTree->BlackboardAsset)
{
BlackboardComp->InitializeBlackboard(*(AICharacter->BehaviorTree->BlackboardAsset));
}
UGameplayStatics:GetAllActorsOfClass(GetWorld(), AAIPatrolPoints::StaticClass(), AIPatrolPoints);
BehaviorComp->StartTree(*AICharacter->BehaviorTree);
}
}
I have done that code which I found from the tutorial Unreal Engine C++ Tutorial - Stealth Game AI - YouTube around 21:13 however I keep on having an issue with:
UGameplayStatics:GetAllActorsOfClass(GetWorld(), AAIPatrolPoints::StaticClass(), AIPatrolPoints);
as I have either have the problem identifier GetAllActorsOfClass is undefined with one colon or UGameplayStatics as it needs a class or namespace after it with two semi colon. So can someone tell me how to recitify it please.