Easy Enemy Health Bars in Unity

Channel:
Subscribers:
29,000
Published on ● Video Link: https://www.youtube.com/watch?v=_lREXfAMUcE



Category:
Tutorial
Duration: 9:25
42,432 views
917


The main difference between a Player's Health Bar in the HUD vs an Enemy's is creating the Health Bar in WORLD SPACE.

In stead of overlaying UI on the Camera, the Enemy or Game Object itself has a Canvas attached to it as a child object, and the UI is a part of the Enemy GameObject.

The benefit of this is the Health Bar follows the Enemy around, the downside is we need to make sure it stays oriented and positioned properly as it does.

Learn all about how to solve for that easily here without needing a single asset of your own.

Using Unity's Slider UI component out of the box we can use the guts of that to make a working health bar in close to 5 lines of code.







Tags:
bmo
unity
tutorial
unity tutorial
enemy health bar
health bar
unity enemy health bar
world space health bar
unity world space health bar
how to make an enemy health bar
healthbar
bmo unity tutorial
2d health bar
3d health bar
2d game
3d game
unity 3d tutorial
unity 2d tutorial
unity easy health bar
unity health bar tutorial
unity enemy health bar tutorial
unity 3d health bar
unity 2d health bar
beginner tutorial
c#