- Home /
button question
Hello, all. I have a question. I have this script: function () { if(GUI.Button("x")) { Application.LoadLevel("whatever"); } }
Is this a good script? It gives an error it says: put a semicolor at the end (6,2) Ty, already
Answer by You! · May 28, 2012 at 06:44 PM
That is not a good script because everything needed for GUI.Button() is not given. Here is what you need:
1) A "Rect()", which contains (in this order, separated by commas)
a)The x value for the position of the upper left corner
b)The y value for the position of the upper left corner
c)The width of the button
d)The height of the button
2) The text string of the button (you have this)
You also aren't actually calling for a specific function instead of
function()
You need
function OnGUI()
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
ArgumentException: method return type is incompatible 1 Answer
How To Make GUI Buttons Load/Quit 1 Answer
I have created a button with photoshop and i need to use it in my menu 2 Answers
Reset button 1 Answer