- Home /
';' expected. Insert a semicolon at the end. already one there?
saying that its expecting one within the code but i cant find it as im still very new to javascript so can someone help me find the problem.
#pragma strict
var Level1=true;
var Level2=true;
var Back=true;
function OnMouseEnter(){
renderer.material.color=Color.red;
}
function OnMouseExit(){
renderer.material.color=Color.white;
}
function OnMouseDown(){
if(Level1==true){
Application.LoadLevel(0);
}
else if(Level2==true){
Application.LoadLevel(0);
}
else(Back==true){
Application.LoadLevel(1);
}
}
i dont think i need too as im only make some text change colour and load other levels
Answer by Pendrokar · Jul 15, 2014 at 08:20 PM
else(Back==true){ Application.LoadLevel(1); }
Are parenthesis after an "else" statement even allowed in Javascript/UnityScript? Perhaps that is the problem.
Thank you very much it doesn't work with parenthesis after else.
Your answer
Follow this Question
Related Questions
Insert a semicolon error 1 Answer
What am I missing? I already have the semicolon at the end.. 1 Answer
Scripting error: ';' expected. Insert a semicolon at the end. 2 Answers
Assets/PlayerControl.js(3,21): UCE0001: ';' expected. Insert a semicolon at the end. 1 Answer
doing force and spin on a gameobject when clicking on plane. 2 Answers