Hi! I was having trouble with this code.
`
var toggleGUI : boolean;
var textFieldString = “text field”;
function OnMouseDown () {
toggleGUI = true;
}
function OnGUI () {
if (toggleGUI == true){
GUI.Button(Rect (20,40,150,20), "Text Information");
GUI.Button(Rect (20,80,80,20), "Video");
GUI.Button(Rect (20,120,80,20), "Images");
if(Input.GetTouch==GUI.RepeatButton(Rect (20,40,150,20), "Text Information")){
textFieldString = GUI.TextField (Rect (20, 160, 80, 20), textFieldString);
}
}
}
`
I was able to show three buttons once the user taps the designated collider. The trouble comes when the “Text Information” button is pressed, the message string “text field” does not appear. What am I doing wrong? Thanks in advance!
–EDIT: I realized I used RepeatButton when it should have been just Button. My wrong.