Health Bar Demo
Posted: Sun Oct 02, 2011 11:09 pm
This is my version of doing health bars with GE.
There is source to another way inside the demo but it is broken and commented out. If you understand how it works and can fix it, or would rather use it, it is in the ManaBar actor, just look at the script.
This shows 3 different health bars:
The skull button is poison, with a displayed timer. Poison will never reach 0 hp. But if you use the down hp button and set to 0 then the health will no longer be poisoned. I did this on purpose.
Four health variables, Two types: INT and FLOAT, the reason is because I used INT for the first version and FLOAT for the newer version. Health should always be done in FLOAT but for some reason MAXHP has to be an INT... Look in the HealthBar script to see why.
The Horizontal and Vertical Health bars change color from Green to Yellow then Red as Health depletes.
There is source to another way inside the demo but it is broken and commented out. If you understand how it works and can fix it, or would rather use it, it is in the ManaBar actor, just look at the script.
This shows 3 different health bars:
- Health Orb
Horizontal Health Bar
Vertical Health Bar
The skull button is poison, with a displayed timer. Poison will never reach 0 hp. But if you use the down hp button and set to 0 then the health will no longer be poisoned. I did this on purpose.
Four health variables, Two types: INT and FLOAT, the reason is because I used INT for the first version and FLOAT for the newer version. Health should always be done in FLOAT but for some reason MAXHP has to be an INT... Look in the HealthBar script to see why.
The Horizontal and Vertical Health bars change color from Green to Yellow then Red as Health depletes.