Game Development Community

Fixed Health Bar Problem

by David Taylor · in Torque Game Builder · 06/01/2008 (6:26 am) · 2 replies

Okay, so I've got a vehicle driving around, and if it collides with another vehicle, it gets damaged, and if it gets damaged enough it is destroyed. Simple enough.

I decided a health bar would be nice, so I applied the Fixed Health Bar behaviour, and when I run Torque, my vehicle is invisible. The camera is mounted to the vehicle, so I know it's still there. It's as if it's under the background image map, but even if I 'drive' out from under that image to a space where there is nothing, the vehicle still can't be seen. It will only move horizontally, too. As soon as I remove the Fixed Health Bar behaviour, I can see the vehicle again and it can move in every direction.

Does anyone know what might be causing this to happen?

#1
06/29/2008 (2:58 pm)
Hmm, you are just adding the behavior to it. I don't remember this happening. You might look into the behavior and see if they have anything in there like %this.parent.setVisible(false); or something. Do you see the health bar floating around but no the car, or are they both invisible?
#2
09/25/2009 (5:40 pm)
Anyone else frustrated on this...don't add it to your player, add it to a sceneobject representing your healthbar