SuperNoob here. As i coded the game along you guys, tried to do something a little bit differently, but i failed (doesn’t work) and i don’t know why:
Basically wanted the game to ask you if you wanted to play again, so i created a function (New match):
void NewMatch() // Not working don't know why
{
Debug.Log("Press Space To Play Again!");
if (Input.GetKeyDown(KeyCode.Space))
{
start_game();
}
}
and called it on the last else if clause of the update() function, like so:
else if (Input.GetKeyDown(KeyCode.Return))
{
Debug.Log("Guessed it!");
Debug.Log("I AM A GENIUS");
NewMatch();
}
Could not, for the life of me understand why the game got fine to the "Press Space to play again part, but would not execute anything in the NewMatch() if statement, not even a debug log. Thanks for any answers, if you need me to post the whole code just ask ^^ (About 75 lines of code)