- Home /
Question by
sacajawhoohoo · Aug 03, 2013 at 08:16 AM ·
errorelseunexpected token
My script keeps getting an error
I keep getting the error "Unexpected token: else" from this tutorial on youtube: http://www.youtube.com/watch?v=YtBegzGYyjc here is my script:
var isQuitButton = false;
function OnMouseEnter()
{
renderer.material.color = Color.gray;
}
function OnMouseExit()
{
renderer.material.color = Color.white;
}
function OnMouseUp()
{
if( isQuitButton )
{
//Quit the Game
Application.Quit();
{
else
{
//Load Game
Application.LoadLevel(0):
}
}
Comment
Best Answer
Answer by Jamora · Aug 03, 2013 at 08:28 AM
You have two opening brackets in your if; i.e. (isQuitButton){{ . You probably meant {}.
thank you i fixed the issue, however now with a new script, i dont have any errors but it is not working:
if (Input.Get$$anonymous$$ey("esc"))
{
//Load Game
Application.LoadLevel(2);
}
the point of this script is for a pause menu and no matter what key i assign it to is does not work
Your answer
