How to attach a UMG widget to a 3D blueprint?

I have created an enemy blueprint that contains a health bar (UMG widget). The only problem is that I want my enemy to be affected by physics and have the health bar to appear above its head. Currently when an enemy is spawned into the world, they fall to the ground but their health bar stays in the same spot in which it was spawned (see attached image - that should be above the cube). I’m really not sure why this is happening. I have tried parenting the UMG widget to the mesh inside the BP but to not avail. Any help would be greatly appreciated.

97154-health.jpg

Thanks for the response. That’s actually what I have done as I thought it would be the way to attach the widget, however it’s not working that way unfortunately. I have my BPs set up as a parent with a widget component inside it. Then, from inside the child BP I have attached the progress bar widget to that component. Is that how it should be done? Or should I be using an arrow/attach point instead?

  1. Go into the blueprint of the actor that you want to attach a healthbar to
  2. Add a new component → Experimental → Widget
  3. In the detail panel of that widget, go to the User Interface tab. For widget class, select your health bar widget
  4. In the viewport, move the healthbar widget into the position that you’d like

The widget should then be attached to the actor wherever it moves

Could you give a screenshot of your child blueprint? Specifically, the component tab?

I think this is a simple matter of reattaching the widget

Sure. Here you go.

97173-component-panel.jpg

Ok, looks like all you have to do is in the parent blueprint attach the health widget not to the root, but to the mesh like in the image below

97241-temp.png

Ah ha! Thank you :slight_smile: This is actually what I had to begin with but the reason I couldn’t see the health bar when I did it was that I had the bar set so low (vertically) that is was inside the mesh. Oh I’m a wally. Thanks for your help!