Help to change to a different scene when on a specific one

Your if statement is wrong. Basically, when writing an if statement, there are brackets () like that which contain a condition. You want all your conditions to be inside that one bracket otherwise it won't work, and your conditions are in 2 seperate brackets. Secondly, you want to remove the semi-colon after your if statement. Semi-colons are essentially used to 'end the sentence' however with an if statement, you don't want it to end as you want it to extend to the curly brackets if the condition is true. If my explanation confused you I apologize, but basically get rid of the semi colon after the if statement, and surround the two conditions in brackets like so and it will work:

{

if (score > 5 && scene.name == "Level1")

{

Health.p_lives = 3;

reset_score.Restart_score(0);

SceneManager.LoadScene("Level2");

}

}

/r/Unity2D Thread