I’m trying to make a box wich shows my Health and Mana in my game. But I also want it to be able to show other stats when pressing a button. But i can’t seem to get it to work.
this is my code:
function OnGUI ()
{
if(Input.GetKeyDown(KeyCode.Tab))
{
GUI.Box(Rect (0,0,100,100), "Health: " + Health + "\n Mana: " + Mana + "\n Strength: " + Strength + "\n Agility: " + Agility + "\n Willpower: " + Willpower);
}
else
{
GUI.Box(Rect (0,0,100,40),"Health: " + Health + "\n Mana: " + Mana);
}
}
I tried to make a
print (“bla bla”);
And it printed the text, but it doesn’t seem to change the GUI.box