I was trying to create a GUI box upon the click of the mouse. If I try to print a sentence, or pause time, that works fine. However, I cannot get a box to be displayed. Below is the segment of the code I have for it (crossPenalty and stringToEdit are declared at the beginning of this script). This code is in my OnGUI() function. I’ve been searching through forums to find guidance but nothing works still… I would love my advice with this problem.
Thank you!!
Ro
if(crossPenalty)
{
var msgtxt = "What is the smallest prime number?";
// Show message in GUI box when player enters the penalty area
//GUI.Box ( Rect( 200, 100, 320, 110),msgtxt);
// Make a text field that modifies stringToEdit
stringToEdit = GUI.TextArea (Rect(200, 220, 300, 50), stringToEdit, 200);
if(GUI.Button(Rect(500, 222, 60, 45), "Submit"))
{
//Time.timeScale = 0.000001;
//GUI.Box ( Rect( 200, 250, 320, 70), "HERE");
print ("You clicked the button!");
GUI.Box ( Rect( 200, 100, 320, 110),msgtxt);
//print ("Where is the box?");
}
}