I’m trying to create a small UI and I’m trying to extract the Canvas->SizeX information from the Canvas member present in the base HUD class that my own class derives from.
In my test project, there’s absolutely no problem. However, in the real project, I keep getting a null pointer for the “Canvas” member.
Any idea what’s going on?
//…
#include “Engine/Canvas.h”
//…
AHumanHUD::AHumanHUD(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
//…;
}
void AHumanHUD::DrawHUD()
{
Super::DrawHUD();
}
void AHumanHUD::BeginPlay()
{
Super::BeginPlay();
float test;
if (Canvas) <== never other than 0.
{
test = Canvas->SizeX;
}
}