Hello,
I am having a very basic issue, the code doesn’t compile when I have a UAIPerceptionComponent inside my Pawn class.
Header:
UCLASS(BlueprintType)
class THRAWN_API AAIBasicSensor : public APawn
{
GENERATED_BODY()
public:
UPROPERTY()
UAIPerceptionComponent* AIPerception;
// Sets default values for this pawn's properties
AAIBasicSensor();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
};
Cpp:
// Sets default values
AAIBasicSensor::AAIBasicSensor()
{
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
AIPerception = CreateDefaultSubobject<UAIPerceptionComponent>(TEXT("AIPerception"));
}
This is the entire code. The error message is:
Does anyone know why this is the case? Thank you.