I draw every piece of my HUD from different Widget Blueprints which I attach and detach dynamically to the Viewport through the Character Blueprint. If I’m correct this way I only process those pieces of HUD which are currently used (attached to the Viewport) and it’s generally efficient. Am I wrong?
If I’m right, what do I need the HUD Class for? I have to attach one to my GameMode but other than that I see no use for it. If you need a Character Controller independent HUD it surely does make sense. But if you don’t need a independent HUD, it’s just sitting there and checking for Input every tick which it will never receive?
The HUD doesn’t do that much work if you’re not using it. You can safely ignore it. You still need it if you want to do some immediate mode style painting directly onto the canvas. Doing it with UMG is cumbersome. In fact most of the primitive slate drawing APIs are not exposed to blueprints yet, and those APIs still don’t cover all the things canvas permits. So you’ll need the HUD if you decide to do such things.
Alright, thank you very much for explaining this in Detail! I understand that the performance impact is absolutely negligible. It just makes me feel better if I may set something to “none” as long as I don’t really need it.
I wanted to kind of not make a new Thread, so I used this one since it goes into the same question of HUD and UMG.
Since I am creating a Framework Tutorial on my YouTube Channel, I was now wondering if the HUD Class should be considered to be used as a manager for handling also UMG. Now I do understand that HUD is instantiated per Player and I also do understand that essentially I can place UMG Widgets to be added to the Viewport on any Actors.
Doing so on the HUD Class, does it have any concern or impact handling some of the more global Widgets, such as Menu and Player HUD?
The HUD Class won’t be obsolete in the future, right? SInce I see that Unreal Tournment basically uses HUD Class and Canvas Class extensively.
In general I am asking, because I do understand the concept of having a Game Mode, Game State, PlayerState, PlayerController… and what it is needed for, and what is replicated and what not, but I just don’t know when using UMG but **not **Canvas, if the HUD Class can be used regardless without any concerns that there is something other going on that my UMG.