- Home /
Why do i get an EOF error?
var isQuitButton = false;
function OnMouseEnter()
{
renderer.material.color = Color.green;
}
function OnMouseExit()
{
renderer.material.color = Color.white;
}
function OnMouseUP
(
//are we dealing with quit button?
if( isQuitButton );
{
//quit game
Application.Quit();
}
else
{
//load level
Application.LevelLoad(1);
}
)
It says there should be an EOF on the else line. Why I haven't left any brackets open to my knowledge.
And on the if( isQuitButton ) I get an unexpected token: if (BCE0043) Does anyone know why?
Answer by DESTRUKTORR · Sep 01, 2013 at 07:51 PM
last line: ")" is not a bracket. That is a closing parenthesis.
Also, for function OnMouseUp you've got an opening parenthesis but no closing one, and no opening bracket.
From now on, if you get an error, you should paste the error on here, or at least tell us which line the error comes back on (it really does help).
Answer by citizen_rafiq · Sep 01, 2013 at 08:23 PM
//ha ha .... I got lot of fun from your jocks
// am i got 10 out of 10?
var isQuitButton = false;
function OnMouseEnter()
{
renderer.material.color = Color.green;
}
function OnMouseExit()
{
renderer.material.color = Color.white;
} function OnMouseUP()
{
//are we dealing with quit button?
if( isQuitButton )
{
//quit game
Application.Quit();
} else { //load level Application.LevelLoad(1); } }
Your answer

Follow this Question
Related Questions
Unexcpected Token error with transform.find 2 Answers
Unexpected token: .. 1 Answer
Unexpected Token: Collider. 1 Answer
Converted a script from C# to JS, Unexpected Token: .. What did I do? 1 Answer