Setting a HUD within the GameMode class

I am not quite sure what I am doing wrong here. I have successfully set my DefaultPawnClass previously, but for some reason the HUD just won’t want to work. For some reason I can’t change it within Project Settings either.

My code as of now is

static ConstructorHelpers::FClassFinder<AHUD> HUDObject(TEXT("HUD'/Game/Blueprints/MyHUD_BP.MyHUD_BP'"));
if (HUDObject.Class != NULL)
{
	HUDClass = (UClass*)HUDObject.Class;
}

I have figured out that the ClassFinder cannot find the blueprint, however I have it, I copied the path with Copy Reference just to be extra sure, plus the DefaulPawnClass has been initialised similarly …

What am I missing ? Thanks in advance.

Hello, I believe it’s done this way.

AFPSGameMode::AFPSGameMode()
{
	// set default pawn class to our Blueprinted character
	static ConstructorHelpers::FClassFinder<APawn> PlayerPawnClassFinder(TEXT("/Game/Blueprints/BP_Player"));
	DefaultPawnClass = PlayerPawnClassFinder.Class;

	// use the custom HUD class
	HUDClass = AFPSHUD::StaticClass();
}

Thank you, it worked. I might just ditch the use of a HUD blueprint altogether.

Hello, I’ve tried this fix but every which way I’ve tried, my desired HUD Blueprint fails to invoke when I run my GameMode. Am I doing something unusual here? Imgur: The magic of the Internet