Health Bar Prefabs

$3.00

There are two parts to this package the first is the MainHealthBarPrefab. This prefab is a screen space overlay object which is meant for the main player’s health. This features a verticle fill image in the bottom left corner. The second part is the WorldSpaceHealtBarPrefab this is a world space overlay canvas meant for other avatars in your game. This feature a horizontal fill image that floats about the avatars. These UI elements will fill based on the current and max health of the player or enemy avatar. There are three main functions that you will use to update the health bars TakeDamage, HealHealth, and LevelUpHealth. TakeDamage will remove health, HealHealth will give health back, and LevelUpHealth increases the total max health.

Want a discount? Become a member!

Description

***README***

Welcome to the README file for Info Gamer’s Health Bar Prefabs

<File System>
InfoGamerAssets
>PlayerHealthBar
>>Demos
>>Prefabs
>>Scripts
>>UISprites

<Included Files>
Scenes: HealthBarDemo
Prefabs: MainHealthBarPrefab, WorldSpaceHealthBarPrefab, PlayerDemo, EnemyDemo, HealthControlDemo

<About>
There are two parts to this package the first is the MainHealthBarPrefab. This prefab is a screen space overlay object which is meant for the main player’s health. This features a verticle fill image in the bottom left corner. The second part is the WorldSpaceHealtBarPrefab this is a world space overlay canvas meant for other avatars in your game. This feature a horizontal fill image that floats about the avatars.

<How to use>

  1. Attach the health script to avatar objects.
  2. Set MaxHealth variable in the inspector.
  3. Drag the MainHealthBarPrefab on to screen space canvas or WorldSpaceHealthBarPrefab on to avatar objects.
  4. Set the Health Bar variable of the Health script to be the health bar object.
  5. Set the Health Stat variable of the Health Bar Script to be the Health script of the avatar object.
  6. Then use the public TakeDamage, HealHealth, and LevelUpHealth function of the Health script to change the current and max health of the avatar objects.

View the demo scenes to get an idea of how this add-on should behave.

<Features>
MainHealthBarPrefab: Verticle fill Image that displays the current health of the player out of the max health.
WorldSpaceHealthBarPrefab: Horizontal fill Image that displays the current health of the player out of the max health.

<Customize your project>
You can change the visual image of the main health bar or the color of the fill. You might also consider changing the size or location of the health bars.

<Final Notes>
Remember to use the public TakeDamage, HealHealth, and LevelUpHealth function of the Health script to change the current and max health of the avatar objects.

Reviews

There are no reviews yet.

Be the first to review “Health Bar Prefabs”

Your email address will not be published. Required fields are marked *