health seems to overlap old health instead of replacing? any idea? heres my script
` for health
video showing it
#pragma strict
var MaxHealth = 100;
var Health : int;
var labelPos : Rect = Rect(100,100,100,20);
function Start ()
{
Health = MaxHealth;
}
function ApplyDammage (TheDamage : int)
{
Health -= TheDamage;
if(Health <= 0)
{
Dead();
}
}
function Dead()
{
respawnMenu.playerIsDead = true;
Health = MaxHealth;
}
function RespawnStats ()
{
Health = MaxHealth;
}
function OnGUI()
{
GUI.Label(labelPos, "HP:" + Health);
}
when i loose health the old health seems to overlap the new health on the label anyway i can stop this?