Intro to UMG (Unreal Motion Graphics) Widgets

In this example we are making two widgets and one blueprint.

The Blueprint is a burning bush. When the player runs into it, some text is displayed on the screen, the player loses 0.1 in health and is launched back a little bit.

Widget 1 is the text that gets displayed when the player collides with the bush blueprint. This is called up and removed in the bush blueprint.

Widget 2 is a health bar displayed in the upper left corner. This gets called up in the player Blueprint and is always on.

 

screenGrab

Below is the UMG interface. I added a progress bar to the slate and clicked “Bind” in the place circled.
healthBarUMG

Below you can see what is in the graph for the progress bar binding. I am just casting to the 3rd person blueprint and getting the player’s health.

healthBar

Then I call the health widget up in the 3rd person Blueprint under Event Begin Play:

firstPersonBluePrint

This is the most programming we need to do. Below you see the burningBush Actor Blueprint. Under Event Begin Play I make a variable for the text widget. When the player overlaps with burningBush, first I check to make sure the widget isn’t already displayed. If it’s not, I put it up for a second, cast to the player, make him lose health, launch him back for a bit, and then remove the text:
bushWidget