Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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.

alt text

Product Version: UE 4.9
health.jpg (49.0 kB)
more ▼

asked Jul 05 '16 at 05:06 AM in Blueprint Scripting

avatar image

20 4 7 10

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first
  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

more ▼

answered Jul 05 '16 at 06:38 AM

avatar image

569 21 9 35

avatar image nati8boy Jul 05 '16 at 06:53 AM

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?

avatar image Mookaroni Jul 05 '16 at 07:29 AM

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

I think this is a simple matter of reattaching the widget

avatar image nati8boy Jul 05 '16 at 12:25 PM

Sure. Here you go.

alt text

avatar image Mookaroni Jul 05 '16 at 06:06 PM

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

alt text

temp.png (26.2 kB)
avatar image nati8boy Jul 05 '16 at 10:18 PM

Ah ha! Thank you :) 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!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question