Help with Health Bar (Solved)

Using :ersion 2.49b

I was wondering if anyone could give me some assistance please. I’ve got the health bar set up but now I need to link it to a character so when they get hit by a bullet the bar will drop. I’m assuming this would be done with collision but I’m not sure how to go about it.

I followed a tutorial for just the bar HERE

I also followed a tutorial for a HUD from HERE

Links are merely to show you what I’ve done soo far.


The Bar’s Length must depend on a Property “health” of the Player, and whenever he is hit (which can be done with a Collision Sensor (that Sensor could as well look for a Property “bullet” that the Bullets would have)) the Player’s Property “health” shall be lowered. (You can do that with the Property Actuator, or with Python.) you

Thank you for steering me in the right direction! I now have it figured out. My problem was because the HUD and Health Bar are on a different scene than the character it had no way to link to it. So to solve this I created a Collision that reported the msg Health -HP on the character. Then in the Hud I created a msg so the bar would look for that to be sent, when it found it being sent it would then go to the action to drop the HP by -10 or whatever I specified.

So in short here’s what I have set up and working…

“Main” Scene
sensor controller actuator
COLLISION Prop:Bullet------AND-------MESSAGE Subject:Health -HP

“HUD” Scene
Health Bar:
sensor controller actuator
MESSAGE Subject:Health -HP-------AND-------PROPERTY Add Prop:Health Bar Value:-10

Thanks again C.A.ligári! That’s twice you’ve come to my rescue after a full day of confusion…lol.