i would like to ask what is the best and simple code for changing to the next level when a game object is triggered?

once the enemy is defeated the player will move to the net level after moving to the other side of the game…the movements of the character is just either left or right no jumps…and it is 2d thanks…

Application.LoadLevel(Application.LoadedLevel+1)

Make sure to put all of your level in the build settings.