- Home /
UCE0001: ';' expected. Insert a semicolon at the end."
Hey guys
I'm trying to adjust the size of the text on my screen for my HSC major work but keep getting this error message
"Assets/Script/Menu Character.js(10,17): UCE0001: ';' expected. Insert a semicolon at the end."
here is the code that i sourced from a unity help forum
function OnGUI () {
GUIStyle myStyle = new GUIStyle(GUI.label);
myStyle.fontSize = 50;
GUI.Label(Rect(0,0,Screen.width,Screen.height),"W = Walk Forward\nS = Walk Backwards\nA = turn left\nD = Turn Right" ,myStyle);
}
The line noted by unity as needing a ; at the end already has one. "GUIStyle myStyle = new GUIStyle(GUI.Label);"
any help regarding this error in my code would be much appreciated =) Thanks
I suspect that you are missing vital code in your question. That error message can also come from a missing or one to many },{,( or ).
$$anonymous$$ost likely ( or )
Please post full code.
Answer by RudyTheDev · Feb 27, 2014 at 01:11 PM
You are coding in JavaScript, but using a C# syntax.
Firstly, you are declaring you variable in C# syntax, it is var myStyle = ...
in JavaScript.
And secondly, you are using new
construct, which is just ... = GUIStyle(GUI.label);
in JavaScript.