UE4 Guide: Health Bars and In-World Widgets
Events
Subscribe:  iCal  |  Google Calendar
London GB   21, Jan — 23, Jan
Taipei TW   24, Jan — 29, Jan
Zürich CH   31, Jan — 4, Feb
Leamington Spa GB   31, Jan — 3, Feb
Bradford GB   6, Feb — 11, Feb
Latest comments
by Joel Alexandre
8 hours ago

Hi. Can you tell how the glass material was made? I found it very interesting.Congratz

by Brayden Marco
17 hours ago

There are no barriers with borders. We provide Java assignment help to the students based in Australia, the UK, New Zealand and the US. Also, writing a program using C, C++, C#, Python, Ruby, and JavaFX is not a challenging task for our experts. https://www.allassignmenthelp.com/java-assignment-help.html

by Alvar Lagerlöf
17 hours ago

Dammit. Not again. This is path tracing not Ray tracing. Ray tracing is practically an hybrid scam. This is the real stuff, the stuff from Disney and Pixar movies. Stop helping Nvidia sell ray tracing. It's not good.

UE4 Guide: Health Bars and In-World Widgets
29 March, 2018
News

Tom Looman has recently published an article on adding UI for things like health bars, nameplates, interaction prompts and more in Unreal Engine 4. These tasks are not so challenging, but it’s always nice to know some tricks not to waste time. The guide is mostly focused on C++, but the developer has also shown Blueprint-only trick.

Check out a little piece of the tutorial to get interested:

The Simplest Implementation in Blueprint

Not everyone wants to touch C++, and it’s not really required. You may also not like the idea of the custom UserWidget base class for your UI elements moving forward (those are will be drawn into the world at least). You could do this in Blueprint too, just a little different. Here is the basic principle of how you could achieve the same result in your Blueprint project in a quick and straightforward manner.

I created a fresh Widget Blueprint, added a variable called OwningActor of type Actor. Now I access the Widget Component on the Actor that will own the Widget (eg. the Player pawn Blueprint from the image above) during BeginPlay, and we get the “User Widget Object” which we need to cast to the correct type. Finally, we fill in the OwningActor variable with the Actor “self” and we’re done!

In the above example, we added the widget blueprint to a grenade actor so it can display the information on mouse-over when the player sees it in the world. Look at the end of the post for some more context screenshots in case you’re not quite following this yet.

Tom Looman 

You can find the full article here.

Leave a Reply

Be the First to Comment!

avatar
wpDiscuz
Related articles