Widget HUD Question

Hi.

I’m a newbie and I ve got a question I didn’t find in the docs:

When I add a new widget on the event scrip, should I Duplicate the “create user widget” and “add to viewport” or not?

That’s kinda strange description, but if I understand correctly, after creating widget through “Create widget” function, you can if you want add it to viewport by using “add to viewport” function. Basically it looks something like this:

and you can remove it from viewport at any given time(Remove from parent function), by using variable referencing it(Just like in screenshot).

I ve got a stamina bar, I ve done it by casting it to the main controller>Set player controller> Create User Widdget> Add To viewport.

I want a health bar, how to link it with

Maybe you do player HUD wrong in the first place? Why would you add a stamina bar, as separate widget? maybe it’ll be easy to create one widget HUD, and then add to it all your UI stuff like stamina bars, health bars, ammo left text etc etc…? Then all you need to do, is to add this widget HUD to viewport, and that’s it.

You still can control all your **custom **widgets inside of it, by promoting them to variable, and then creating functions inside your HUD widget to control them from the outside, if you want to.

I’m sorry about my explaination, I ve got only one widget blueprint onto I add stuff, but I don’t know how to create the link for multiple elements and I looks like the way I try, without duplicating the path doesn’t work but I repeat I’m a newbie, If you got link for it, that would be wonderfull, only found how to do only one every time.

You should watch this series - it helped me understand UMG. UE4 UMG - It is outdated so things might be a little bit different if you are using 4.13, but the concepts are good for the most part - Except it is not always good to bind all of the properties because they run as a tick.

21d3b58450a64f676367fce28d0c1319e71e26e1.jpeg

There’s my HUD input, How to add more stuff? Is that in the widget graph or the character BP?

I ve understood, everytime I had a widget I have to put it in order after event begin to play like Main menu>HUD>Game Over, and then just set display in the widget graph… Right?