I had that error before and it was fixed after opening and closing the editor several times. Now I am creating my new project and I can’t make it work by being so easy. Here I leave my code and some screenshots:
.h:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "MenuGameModeBase.generated.h"
/**
*
*/
UCLASS()
class GAME_API AMenuGameModeBase : public AGameModeBase
{
GENERATED_BODY()
public:
AMenuGameModeBase();
};
.cpp:
// Fill out your copyright notice in the Description page of Project Settings.
#include "MenuGameModeBase.h"
#include "MenuHUD.h"
#include "MenuPlayerController.h"
AMenuGameModeBase::AMenuGameModeBase()
{
HUDClass = AMenuHUD::StaticClass();
PlayerControllerClass = AMenuPlayerController::StaticClass();
DefaultPawnClass = NULL;
}
When I compile and add it to the “GameMode Override” of my level, the changes should be seen.
I am also adding it in the global configuration in Maps & Modes, I select my level and my Default GameMode:
will it be a bug?, compile and close several times