I am trying to create a new class to be my “EnemyPawn” class, but wanted to utilize the built in movement component of the DefaultPawn class instead of the Pawn class. However when I do this, the .cpp file has nothing in it except for the ‘include’ of the header file.
For example, this is the contents of the header file:
#pragma once
#include “CoreMinimal.h”
#include “GameFramework/DefaultPawn.h”
#include “Mob.generated.h”
UCLASS()
class BREADBOY_API AMob : public ADefaultPawn
{
GENERATED_BODY()
};
And this is the entire contents of the .cpp file:
#include “Mob.h”
When I would normally expect the .cpp file to have something like:
#include ”Mob.h”
AMob::AMob()
{
PrimaryActorTick.bCanEverTick = true;
}
void AMob::BeginPlay()
{
Super::BeginPlay();
}
Is this the expected behaviour? I tried adding in these functions like the constructor and beginplay manually but they just error. Any guidance appreciated.
Edit:
I may just go with using character class for my enemies to simplify things, but would still be good to know to understand why it does this. If you can point to some documentation or something that explains it that works too, couldn’t find what I was looking for on that note.