- Home /
UCE0001: ';' expected. Inser a semicolon at the end
I've got this error with my class and cant seem to know what is wrong i know it might be a stupid thing i cant see, but i did the same thing my teacher did and his works but mine keeps on giving me the error, its on line 5,25 and I've tried putting an = between the float and 3.0; but it didnt work :/
#pragma strict
private var doorIsOpen : boolean = false;
private var doorTimer : float = 0.0;
var doorOpenTime : float 3.0;
var doorOpenSound : AudioClip;
var doorShutSound : AudioClip;
function Start () {
doorTimer = 0.0;
}
function Update () {
if(doorIsOpen){
doorTimer += Time.deltaTime;
if(doorTimer > doorOpenTime){
door(doorShutSound, false,"doorshut");
doorTimer = 0.0;
}
}
}
function DoorCheck(){
if(!doorIsOpen){
door(doorOpenSound,true, "dooropen");
}
}
function Door(aClip : AudioClip, openCheck : boolean, animName : String){
audio.PlayOneShot(aClip);
doorIsOpen = openCheck;
transform.parent.gameObject.animation(animName);
}
Line 5 needs an equals. You said that adding this doesn't change things, but I am not sure I believe that. ;-)
Answer by robertbu · Oct 16, 2013 at 03:46 PM
You need an equal sign on line 5 just like you used an equal sign on the previous line:
var doorOpenTime : float = 3.0;
Also given all of your earlier calls, your 'Door()' function should be 'door()'. Note programmers on this list use the convention that functions and types start with upper case letters, where variables start with lower case variables. So by this convention, all of your 'door()' calls should be 'Door()' calls.