I’m setting up the UI to the health code
void OnGUI() {
GUI.Label(new Rect(10, 10, 700, 40), "Health" + GetComponent<Health> Health);
}
This is a separate script
#pragma strict
var MaxHealth = 100;
var Health : int;
function Start ()
{
Health = MaxHealth;
}
function ApplyDammage (TheDammage : int)
{
Health -= TheDammage;
if(Health <= 0)
{
Dead();
}
}
function Dead()
{
RespawnMenuV2.playerIsDead = true; //VERY IMPORTANT! This line was added in tutorial number 19. If you haven't reached that tutorial yet, go ahead and remove it.
Debug.Log("Player Died");
}
function RespawnStats ()
{
Health = MaxHealth;
}
But there’s an error : error CS1525: Unexpected symbol `Health’ How can I fix that?