All Compiler errors have to be fixed before you can enter playmode

so i am getting the following error

All Compiler errors have to be fixed before you can enter playmode

i got this error after i tryed to add a code (to restart the game when pressed space button)
once i press the play button i get this error.

i suppose i made a mistake with the coding since it happend after coding the new part.
so i hope you guys can explain why i have this problem
this is the code i added

void Update ()
{
if Input.GetKeyDown(KeyCode.Space)
{
Application.LoadLevel (0);
}
}

Conditionals have to be wrapped in parentheses.

if (Input.GetKeyDown(KeyCode.Space))
{

}

hey
thanx a lot this indeed works
so everything with if / else condition has to be wrapped in parentheses then ? or does this only apply for if conditions ?
coding sure is tricky so i hope i can get the hang of it soon :slight_smile:
i do have one more question (if i have to make a new topic for it let me know)
is it possible if you created a floor(plane) and once you collect all collectable points there will be a sort of teleporter that moves the player towards another location or to make a hole in the floor so the player can move to other levels ? (not sure what is the best way to do for a starter who try to make her first game.
for now i followed the tutorial of roll a ball. and i want to expand the game to my own first game

if()
{ }
else if ()
{ }
else
{ }

Would be a normal way. Curly brackets only required if you have more then one line that goes with that condition.

Yes, what you want is possible.

thanx for the other question what way would be best to try ? a teleporter or a hole that appear in the floor where the player will fall trough?

It’s really up to you. Teleporters aren’t hard to set up, a collider set as a trigger where you create some sparkles or something shouldn’t be that hard. But a hole should work also. Depends on what makes more sense in your game.