- Home /
Javascript Expecting Errors ';' & '='
i have these 7 errors showing in my console
Car.js(323,10): BCE0044: expecting (, found 'CheckHandbrake'.
Car.js(323,26): UCE0001: ';' expected. Insert a semicolon at the end.
Car.js(325,9): BCE0043: Unexpected token: if.
Car.js(325,49): UCE0001: ';' expected. Insert a semicolon at the end.
Car.js(327,17): BCE0043: Unexpected token: if.
Car.js(327,31): UCE0001: ';' expected. Insert a semicolon at the end.
Car.js(329,35): BCE0044: expecting :, found '='.
and the part of the script its reffering... (from lines 323 to 329)...
function CheckHandbrake()
{
if(Input.GetKey("space") || isHandBrake)
{
if(!handbrake)
{
handbrake = true;
and heres the rest of the same script...
function CheckHandbrake()
{
if(Input.GetKey("space") || isHandBrake)
{
if(!handbrake)
{
handbrake = true;
handbrakeTime = Time.time;
dragMultiplier.x = initialDragMultiplierX * handbrakeXDragFactor;
}
}
else if(handbrake)
{
handbrake = false;
StartCoroutine(StopHandbraking(Mathf.Min(5, Time.time - handbrakeTime)));
}
}
Where is the rest of that function?
You don't appear in this fragment to be closing the two ifs or the function.
I didnt post the entire script thats why, I've updated the original question with a longer sample of the script up to the point of closing it with a }
does this help? thanks by the way
Actually from your error I suggest the code before that function is the problem - can you post that too?
I was missing a { earlier on in my code. moral of the story, double check your {'s
Your answer
Follow this Question
Related Questions
little problem with java script 1 Answer
I need help with an error 1 Answer
not sure whats happened :S 1 Answer
scripting colliders errors 1 Answer