said in the title i cant make my GUI label show my int in it here is the code
#pragma strict
var LabelBool : boolean = false;
var InfoMenu : boolean = false;
var Health : int = 100;
function OnGUI ()
{ if ( LabelBool )
{
GUI.Label (Rect (0,0,50,50),"Press E");
}
if ( InfoMenu )
{
GUI.Label (Rect (0,0,75,50), "Health " Health);
GUI.Box (Rect (0,0,250,350),"Player Info");
}
}
function Start ()
{
Debug.Log ( Health );
}
function Update ()
{
if ( Health )
{
Health = 80;
}
if (Input.GetKeyDown (KeyCode.E))
{
InfoMenu = !InfoMenu;
}
}
function OnTriggerEnter (other : Collider)
{
LabelBool = true;
}
function OnTriggerExit(other)
{
InfoMenu = false;
LabelBool = false;
}
function OnTriggerStay(other)
{
if ( LabelBool == true && InfoMenu == true )
{
LabelBool = false;
}
if ( LabelBool == false && InfoMenu == false )
{
LabelBool = true;
}
}