Unreal Engine Tutorial - Character Health Displayed In A Widget -

Channel:
Subscribers:
234
Published on ● Video Link: https://www.youtube.com/watch?v=BQFoR44jEMc



Game:
Widget (1992)
Category:
Tutorial
Duration: 11:15
243 views
4


Unreal Engine Tutorial - Character Health

๐Ÿ‘‹Hi, and thanks for watching my video!๐Ÿ˜Š

In this video, I am adding health to my character and displaying it in a widget over the character's head.
- Daniel, from ๐Ÿ‘‰ https://www.bloghoarder.com/ ๐Ÿ‘ˆ

What we will do:
Add "health" variable to the character.
Damage character with the enemy attack.
Show character health and damage with a widget over the character's head.
Start the level over when the character's health reaches 0.

Here's how to do it:

Character Blueprint
Inside the character blueprint, add a new variable (integer) and name it health.
Compile and set the health value to 100.

Enemy Blueprint (collision that damages character)
Add a box collision to an enemy weapon.
On "Component Begin Overlap" cast to character with "health."
Get "health."
Subtract 10 "health".
Set "health" with the subtracted "health" value.

Character's Health Widget (displayed overhead of character)
Create a "health widget" from the content browser.
In the widget, add a "canvas panel."
In the top right-hand corner select "Custom Size" and Size it 100x200.
Add a "progress bar" to the "canvas panel."
Size the bar and anchor it.
Under "Appearance" you can change the colour of the progress bar.
Under "Progress" change the "percentage" to 100.
Click "bind" and "create binding."
In the binding, cast to the character, drag "get player pawn" from the object input.
"Get health", from the character and connect the health to the return node.
Drag off the conversion node and "divide."
Input to divide 100 and then plug the division result into the return node.

Back in the character's blueprint
Select the character's mesh.
Add a widget.
In widget details, under "user interface" chose the health widget from the "widget class."
Change the "draw size" to match the widget's custom size.
In the "event graph" drag off of the "event tick" cast to a branch.
"Get health" and drag off for a "less than or equal" and leave number as 0.

Here is a level transition tutorial.

https://www.youtube.com/watch?v=9U_U7Dx9Ce4&list=PLAMN4WCH4g9J6C-2goigkmm_oDkcSzecH&index=3&t=1s

Here are the steps from the level transition tutorial.
Create Widget (select your loading screen widget - Add to viewport - Delay (keep time at .2) - Open level by name (insert name of level).

Thanks again for watching!
Be well and have a great day.
Consider checking out my website ๐Ÿ‘‰ https://www.bloghoarder.com/ ๐Ÿ‘ˆ




Other Videos By Blog Hoarder


2024-02-09Wartales Live Stream -Marching south toward the DLC #wartales #gaming #RPG #livestream
2024-02-03Unreal Engine TutorialโŒšIN UNDER A MINUTEโŒšHow To Migrate Assets Between Projects #unrealtutorial
2024-01-20UNREAL ENGINE: Load & Change LevelโŒšIN UNDER A MINUTEโŒš #unrealtutorial #unrealengine #gamedev #unreal
2024-01-16Resident Evil 4 Handgun Sniper #residentevil4 #residentevil #horrorgaming #gaming #zombieshorts
2023-12-14ResidentEvil4 ๐Ÿค”DID I MENTION I WANT TO MELEE#residentevil #zombieshorts #twitchclips #horrorgaming
2023-12-10#callofduty ๐Ÿ”ซBlack Ops Cold War's Campaign is a thrill ride! #callofdutycoldwar #codcoldwar #cod
2023-12-09Burning the junkyard in COD BO Cold War #callofduty #cod #callofdutyblackopscoldwar #twitchstreamer
2023-12-02๐Ÿ”ฅYou're Fired!๐Ÿ”ฅ Call of Duty BO Cold War - Game Clip-๐ŸŽฅ Roasting Weenies. #callofduty #twitchclips
2023-09-08Unreal Engine Tutorial How To Create multiple starting locations in the same level.#unrealtutorial
2023-07-27Adventure, excitement, a Jedi craves not these things... STAR WARS JEDI FALLEN ORDER
2023-06-03Unreal Engine Tutorial - Character Health Displayed In A Widget -
2023-05-07Battlefield 5 Best Clips 2023 -Part 1-
2023-04-28โ›ณSmall World Of Golf - Gameplay Trailer
2023-03-25Unreal Engine 4 Tutorial - How To Replace The UE4 Mannequin
2023-03-24Virgil Dumbfound - #01 Who's the Boss? - 25 second animated comic strip
2023-02-21Possible ๐Ÿ›ธUFO Sighting 21Feb2023 Ontario, Canada๐Ÿ
2023-02-07Unreal Engine Tutorial - How To Package Project - Create Game File -
2023-01-04Unreal Engine 4 Tutorial - Widgets (main menu video widget & player hud)
2023-01-03Tank explodes and then time travels back before impact for a full recovery?! Battlefield 5
2022-02-27"Swipe Right" a short horror story - Audio -
2022-01-26Unreal Engine 4 Tutorial: How to create a Landscape Material and paint a Landscape. 2022



Tags:
Unreal Engine
Tutorial
How To
Character
Health
Unreal Engine Health
character build
unreal engine 5 tutorial
unreal engine 4 tutorial
widget tutorial
unreal engine health tutorial
un real tutorial
5unreal
4unreal
howto



Other Statistics

Widget Statistics For Blog Hoarder

Blog Hoarder currently has 936 views spread across 2 videos for Widget. Less than an hour worth of Widget videos were uploaded to his channel, less than 0.47% of the total video content that Blog Hoarder has uploaded to YouTube.