Hi
I am trying to cast my HUD class from AHUD class to AMyProjectHUD inside my character class. But, I am getting some errors when doing it.
Here is the code
APlayerController* MyPC = Cast<APlayerController>(Controller);
AMyProjectHUD* MyHUD;
if (MyPC)
{
MyHUD = Cast<AMyProjectHUD>(MyPC->GetHUD());
}
if (MyHUD)
{
const FVector2D Center = MyHUD->GetCenter();
}
I am getting the following errors
1>d:\ue4\new folder\myproject\source\myproject\myprojectcharacter.cpp(77): error C2220: warning treated as error - no ‘object’ file generated
1>d:\ue4\new folder\myproject\source\myproject\myprojectcharacter.cpp(77): warning C4701: potentially uninitialized local variable ‘MyHUD’ used
1>d:\ue4\new folder\myproject\source\myproject\myprojectcharacter.cpp(77): warning C4703: potentially uninitialized local pointer variable ‘MyHUD’ used