This is really really really annoying me.
I have a HUD, made out of a Widget Blueprint.
And my GameMode is a C++ class.
Header…
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "GameFramework/GameMode.h"
#include "Trek_OnGameMode.generated.h"
class AEnemy;
UCLASS()
class TREK_ON_API ATrek_OnGameMode : public AGameMode
{
GENERATED_BODY()
public:
// Constructor
ATrek_OnGameMode();
// Array of current enemies
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Enemies")
TArray<AEnemy *> Enemies;
};
Implementation…
// Fill out your copyright notice in the Description page of Project Settings.
#include "Trek_On.h"
#include "Enterprise.h"
#include "Trek_OnGameMode.h"
#include "GameFramework/HUD.h"
ATrek_OnGameMode::ATrek_OnGameMode()
{
static ConstructorHelpers::FObjectFinder<UClass> HUDFinder(TEXT("WidgetBlueprint'/Game/UI/GameHUD.GameHUD_C'"));
DefaultPawnClass = AEnterprise::StaticClass();
HUDClass = (UClass *) HUDFinder.Object;
}
This isn’t exactly rocket science , I want the C++ GameMode to accept and use my BP HUD. The current code compiles, but no HUD appears.
I need this for a school project, help would be deeply appreciated.