Displaying Tank health
by Stephen · in Torque Game Engine · 01/08/2006 (4:33 pm) · 1 replies
I have added this Vehicle Health/Energy Bar Resource to display the vehicles health but I noticed when you mount the tank, nothing displays. Could someone help me to fix this?
Thanks
Thanks
Torque Owner Gary Preston
eg:
// don't render unless we're controlling a player
if ( !(controlObj->getType() & PlayerObjectType) )
return;
You'll need to change the type mask "PlayerObjectType" to whatever type the tank class you're using is registered as. It could be a vehicile type or a compleatly new type depending on how its setup. If you want the bar to show for both tanks and players then just extend the above to test for the different types you want to allow.