Sorry if this is a horrible question,
but I have been struggling to figure this out.
I know you can reference blueprints via variables and assign an instance of the blueprint but what about in this scenario…?
So, each player pawn automatically has a HUD assigned. I would like to store a reference to this HUD as a variable within the Character blueprint so I can access functions belonging to the HUD blueprint easily (such as… enabling/disabling HUD, updating it, etc.)
But how can I do this?
The instances are created dynamically at play-time so I cannot assign them physically via the level editor (not that I know of anyways).
Inside of the Character Pawn blueprint I attempt to: self reference → get controller → cast to PlayerController_C → get HUD → cast to HUD_C (but cast always fails here).
I can access the HUD but it takes me various inefficient steps that could cause trouble in the long-run (too much dependency). Currently I have to interact the PlayerPawn with the PlayerController to call Events/functions on the PlayerHUD. I want to get it so there is no middleman… directly call functions on the HUD from the PlayerPawn.
Sorry if I am not making sense or not realizing the obvious.
Any help or guidance is truly appreciated.
Many thanks in advance!
If this helps at all… its my current set-up. (functional)
Personally I think its inefficient which is why i am trying to improve it.
I am new to blueprints… only about 2 weeks so cut me some slack! xD
From a programming perspective, I should be able to initiate / create a new instance of the object (blueprint) on the spot, shouldn’t I?
Is there no way to do this in blueprints? I feel stupid Dx