Health Bar -- Blender Game Engine


 
pageok

  
1.  Add HealthBar.py to the Text Editor

Note:
If you downloaded either the starting blend or the finished blend, you can find HealthBar.py in the Text Editor.  

Download:

Text Editor menu >> Text >> Open
Rename HealthBar.txt to HealthBar.py


 

   
2.  Add an Always Sensor to HealthBar.  Set to run once

Note:
Always Sensor >> Python Controller >> Ipo Actuator
This will initialize the health bar with the player's health

HealthBar selected

Buttons Window menu >> Logic (F4)
Sensors Add
Always Sensor
Set to Run Once


 

   
3.  Add Python Controller:  Use HealthBar.py

HealthBar selected

Buttons Window menu >> Logic (F4)
Controllers Add
Python Controller
Script:  HealthBar.py





 
  
pageok