Hi, I am trying to implement a simple HUD in c++ for my game by following this video
So in my gamemode class I have the following :
protected:
//widget class for hud
UPROPERTY(EditAnywhere,BlueprintReadWrite)
TSubclassOf<class UUSerWidget> HUDWidgetClass;
//instance of hud
UPROPERTY()
class UUserWidget* CurrentWidget;
in my gamemode.cpp i’m trying to do the following:
#include "Blueprint/UserWidget.h"
void ACSUEGameMode::BeginPlay(){
if (HUDWidgetClass) {
CurrentWidget = CreateWidget<UUserWidget>(GetWorld(), HUDWidgetClass);
}
This is giving me the errors: “Use of unidentified type UUserWidget” and " ‘StaticClass’: identifier not found"
I have included the “UMG”, “Slate”,“SlateCore” into my build.cs file and also re generated my visual studio project files
I have these includes in my projectname.h file
#include "Runtime/UMG/Public/UMG.h"
#include "Runtime/UMG/Public/UMGStyle.h"
#include "Runtime/UMG/Public/Slate/SObjectWidget.h"
#include "Runtime/UMG/Public/IUMGModule.h"
#include "Runtime/UMG/Public/Blueprint/UserWidget.h"
Does anyone know what I am doing wrong? Ive been googling stuff for about an hour now and I cant seem to figure this basic step out… Any help is appreciated