I am new to c++ and wanted to learn how to make my AI better so I followed this tutorial: link text
I got to the bit about overriding the function in blueprints after the character and realised that I made a mistake in my code as I couldn’t find the function I defined in c++ anywhere in the list of overridable functions. I can’t find the mistake as I am so new to c++ and hope that someone can. I didn’t do the AI controller part as I prefer altering those settings in blueprints and it said that it was optional to do that step
I know that it is a lot of code to look through but I would really appreciate it if someone could help me find the problem even if that is to link me to another question with the same problem.
// Fill out your copyright notice in the Description page of Project Settings.
#This is for AICharacter.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "AIChar.generated.h"
UCLASS()
class MYPROJECT4_API AAIChar : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character's properties
AAIChar();
UFUNCTION(BlueprintNativeEvent, Category = "AIVariables | Character")
void GetPerceptionLocRot(FVector &OutLocation, FRotator &OutRotation) const;
void GetPerceptionLocRot_Implementation(FVector &OutLocation, FRotator &OutRotation) const;
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;
virtual void GetActorEyesViewPoint(FVector &Location, FRotator & Rotation) const override;
};
#And this is for the AICharacter.cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "AIChar.h"
// Sets default values
AAIChar::AAIChar()
{
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void AAIChar::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void AAIChar::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
// Called to bind functionality to input
void AAIChar::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
}
void AAIChar::GetActorEyesViewPoint(FVector &Location, FRotator &Rotation) const
{
GetPerceptionLocRot(Location, Rotation);
}
void AAIChar::GetPerceptionLocRot_Implementation(FVector &OutLocation, FRotator &OutRotation) const;
{
OutLocation = GetActorLocation() + FVector(0, 0, 50);
OutRotation = GetActorRotation();
}
Many Thanks