Health not updating when taking damage?

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?

Okay, I saw the video, the text is very unclear, but its fine, as you narrate the issue… Its because either you have given two GUI.Label() calls in a script OR you have added the script to two different objects.
If same script is used, you need to use different Rect() for every game object to see clearly.

May be your Player and AI have the same script appended… is it so? check and tell me…
If this solves your issues, Mark it solved.

fixed it guys thanks for ure help i had 2 areas where the same script was applied stupid me :stuck_out_tongue: