(SOLVED) Cannot restart game properly

when i put Startgame() under the print(“i won”) and play it in unity the game it keeps resetting as shown below

I have tried adding additional brackets for just the else if enter input but i would get an error where else if was not working

your last else if statement is missing its brackets
else if(Input.GetKeyDown(Keycode.return))
{
print(“I won”);
StartGame();
}

Thanks sorry for late response it works now!

Privacy & Terms