At first I thought I made a typo, but I haven’t. The code worked just fine not too long ago, and it feels like this problem shouldn’t to be this difficult at all.
Header:
UCLASS()
class MYPROJECT_API AFPSGameMode : public AGameMode
{
GENERATED_BODY()
virtual void StartPlay() override;
AFPSGameMode(const FObjectInitializer& ObjectInitializer);
};
CPP:
void AFPSGameMode::StartPlay()
{
Super::StartPlay();
StartMatch();
AFPSGameMode::AFPSGameMode(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
DefaultPawnClass = AFPSCharacter::StaticClass();
}
if (GEngine)
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Yellow, TEXT("Hello World!"));
}
}
the full error list is:
type name not allowed, line 13
identifier "object initializer" is undefined, line 13
expected a ';', line 14