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?