Whenever i play the game it just shows currentHealth in the top left corner, which is the name of the var in stead of the actual value. As i am pretty horrible at coding, is there anyone smarter out here that can fix this code?
#pragma strict
var currentHealth : float = 100;
var MaximumHealth : float = 100;
var PlayerAlive = 1;
function Start ()
{
if (currentHealth > MaximumHealth)
currentHealth = MaximumHealth;
}
function ApplyDamage (damage : float) {
currentHealth -= damage;
Debug.Log("Hit!");
if (currentHealth <= 0.0) {
Application.LoadLevel("0");
}
}
function OnGUI()
{
GUI.Label(Rect(0,0,100,100), "currentHealth");
}