Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

5u4/unity-health-bar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

License GitHub tag Unity Assets Store

Description

A prefab that shows a character's health.

Demo

How to use

  1. Drag the prefab into the Hierarchy.

  2. Make sure an EventSystem exists in the Hierarchy. (If not, you can create one by creating a canvas element then delete it)

  3. Set health

public float maxHealth;
public float currentHealth;

public HealthBar healthBar;

private void Start() {
    healthBar.SetMaxHealth(maxHealth);
    healthBar.SetCurrentHealth(currentHealth);
}
  1. Update current health when damaged or healed
currentHealth -= damage;
healthBar.SetCurrentHealth(currentHealth);

Video

// TODO: Add a tutorial video while there are plenty enough types of health bars

Unity assets store

http://u3d.as/1nts

About

๐Ÿ’• A cool interactive unity health bar

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages