function Update () {
KeyHandle();
}
function OnGUI(){
var beginQuest : QuestHander = GetcComponent(QuestHander);
if(hud == true && checkKeyDown == true && !beginQuest.start){
GUI.Box(Rect(20,100,500,150), "Hello There, Fancy a job?");
if(GUI.Button(Rect(25,120,100,30),"Yes"){
beginQuest.checkIfDone(true);
}
}
my unity is saying expecting ), but found ‘{’.
It is talking about the line which says:
if(GUI.Button(Rect(25,120,100,30(,“yes”){
How do I change it to fix this as I am new to scripting.
When you run into this kind of error, match all of your ‘(’ with a ‘)’. You can do this by placing your cursor on the ‘(’ and seeing what (if any) ‘)’ is highlighted. You are short a ‘)’ on line 4. You have 3 ‘(’ but only 2 ‘)’. In addition, the code as posted is short one ‘}’ at the end of the file. Keeping your indentations accurate can help.
function OnGUI(){
var beginQuest : QuestHander = GetcComponent(QuestHander);
if(hud == true && checkKeyDown == true && !beginQuest.start){
GUI.Box(Rect(20,100,500,150), "Hello There, Fancy a job?");
if(GUI.Button(Rect(25,120,100,30),"Yes")){
beginQuest.checkIfDone(true);
}
}
}