Custom Player Controller Reference

I have made an object reference variable in my HUD class to my custom player controller called “MyCustomPlayerController”.
I want my HUD to get a variable from it, but nothing happens because the reference is set to “none”, how can I assign it at the “Begin Play Event”?

HUD already has refrence, you can get it via Get Owning Player Controller

I cannot use Get Owning Player Controller for referring to the custom player controller.
The solution to my problem was:

If it didnt worked means HUD was not assigned to player controller, you need to set HUD class in PlayerController, it will spawn it and set owner

No, I meant it returned the PlayerController, not my Custom one. So I couldn’t access the variables. I forgot adding the cast to … so your solution works also:

I think your solution is cleaner.
Same for the HUD reference:

31431-bp.png