UMG and dynamic positions

Hello everyone,

I was wondering, is it actually possible to dynamically create new UMG components (ie. Progress Bar)?

I’m trying to add a health bar at the top of each players head but I’m not really sure this is possible with UMG yet.

At the moment I’m doing it on the HUB blueprint by drawing a dynamic material (inspired by the HUD map in the content example).

Thanks.

Hi Fauzruk.

I know you can make a health bar in UMG. but i dont know if you can make a health bare over player´s/enemy´s. i will look into it when i have some time.

I’ve done something like this. I just made a generic marker widget (button, progress bar, graphic) and create & add it from the actor I want it to track. Inside that actor, I use a tick to update the position of the widget using the Convert World Location to Screen Location function to Set Full Screen Position on the widget.

For example, I have a blueprint of an object that I always want to have a HUD marker associated with it, and there can be an arbitrary number of these in the world at any given moment. Inside the blueprint, I create the widget, and update its’ position based on the world location of the blueprint.

Hey Fauzruk, if you go ahead and make the widget itself blueprint accessible by checking the “is Variable” option you can manipulate the position and size of the widget. You’d have to use the position from the actor that you want to place the health bar above. Feel free to PM me because I just did this a couple of days ago for my own project.

In addition to these solutions you can use right now, you can also wait for the 3D component-based UMG implementation that is expected with 4.5. In this situation, you would just attach the UI Widget to an actor like any other component and it would follow the actor.