How can I get my HUD to access my Character Class?

Hello,

I am tryinging to get a very Simple HUD to work, that just displays a Number that is a property of my Character Class. However, my Character Reference is always NULL. I am worked based of thiss WIKI Post:

A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums,Create_Buttons%26_Draw_Materials

Here is what i try to access the Character:

void AMobaDefaultHud::PostInitializeComponents()
{
Super::PostInitializeComponents();

//How to get a ref to your custom PC
//AYourPlayerController* YourChar = Cast<AYourPlayerController>(ThePC);

//How to Get The Character
if (GetOwningPlayerController() != NULL)
{
	Player = Cast<AMobaCharacter>(GetOwningPlayerController()->GetPawn());
}


 }

The Hud itself works, i assign it in my GameMode an can draw text using simple code. However, the reference to my Character Class does not work. Do I need to do something for this to work?

Try getting your character in BeginPlay() function instead of PostInitializeComponents, i’m not sure about this one, but give it a try.

Well it simply means player controller does not posses anything at that point, you could make playercontroller register pawn to hud class when he possesed new pawn, it will also be optimal if pawn may change.

That actually works. Thanks!