Difference ways to get HUD reference
I'm rather new to UE and what I'm trying to do is fire up a custom event I created in a newly created HUD class from a different blueprint. I managed to do that (by the method below in the image) but I didn't understand why one of the ways was wrong and wouldn't let me access the event.
Can somebody clarify it for me why the first method, the one with the purple node (which I didn't get, what type is it?C++ class?) wouldn't work?
That a class reference, as you can see it purple which indicates that, you can not access object from it, you can only reference class, to spawn or search for object and other things.
HUD object is created and stored as each player need individual instance of it and you can access it via "Get HUD" node.
Also one note, UMG technically don't require HUD object, HUD class is primerly for old canvas HUD system (which is still useful as it allows to draw things more freely), so if you want to you can create widget in PlayerController and if you make single player game you can also place it in GameMode.
answered Jun 02 '19 at 06:53 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here