Question by
OLIISKING · Nov 15, 2015 at 10:17 AM ·
javascripterrorsemicolon
Where to put ;
Hi my unity console says that I'm missing 3 semi-colons WHERE? -I feel so dumb : ( Sorry I'm new to JS. Any help would be thanked. : )
#pragma strict
float Yh = Screen.height / 2;
float Xw = Screen.width / 2;
function Start () {
}
function Update () {
transform.eulerAngles = new Vector3(Input.mousePosition.x + Xw + transform.eulerAngles.x, Input.mousePosition.y + Yh + transform.eulerAngles.y, 0);
yield return new WaitForSeconds(5);
}
Comment
Answer by Avik the great · Nov 15, 2015 at 12:55 PM
Click on the error.It will open up the place where you have written the code and you will observe a line or two is highlighted this will make easy for you t find the errors.
Answer by Jessespike · Nov 15, 2015 at 11:47 AM
Declaring variables in Js is different than in c#
var Yh : float = Screen.height / 2;
var Xw : float = Screen.width / 2;
Remove the yield, that won't work in the Update()
//yield return new WaitForSeconds(5);
Your answer
Follow this Question
Related Questions
Setting EventTrigger in Unity with JavaScript 0 Answers
How to address JavaScript erro in UnityLoader.ja 1 Answer
Error) DataReader already active on this command 0 Answers
Camera doesn't show work properly. 1 Answer
Dropdown error 1 Answer