So I’m trying to make a GUI box that displays a time in second to show how long the game has been going but when I type up the script I get an error saying the Box is not a member of GUI
var timer : int = 0;
function Update ()
{
timer = Time.time;
}
function OnGUI()
{
GUI.Box (Rect (10,10,30,50), "Time" + " " + timer);
}
I even went to the scripting reference for GUI and copied in one of the examples and got the same error
function OnGUI ()
{
GUI.Box (Rect (0,0,100,50), "Top-left");
}
Can someone tell me what I am doing wrong?