Hello, so I am working on my Tutorial series and I came across something that got me stuck, I know it’s really simple, I just can’t figure it out! I need it so when I click the button “Status” I need a GUI box to show up displaying Variables and some text.
var maxHealth : int = 100;
var currentHealth : int = 100;
function Update () {
if(currentHealth < 0) {
currentHealth = 0;
}
if(currentHealth > maxHealth) {
currentHealth = maxHealth;
}
if(maxHealth < 1) {
maxHealth = 1;
}
if(currentHealth < 0) {
Application.LoadLevel ("Gameover");
}
}
function OnGUI ()
{
if (GUI.Button (Rect (120, 10, 100, 20), "Status"))
{
}
}
create your box stuff maybe in a separate function and just use a bool flag when you hit your button so your box stuff get called, in other term make you a toggle “like” things with that flag.
well that is one option, should be straight forward to do i guess