How do i say, if ball is -5 and scene is "MainGame1", go to scene GameOver1 ???

This is the script i have for “MainGame” but i want to add another if statement underneath.

function Update ()

if(transform.position.y < -5)


What i want to do is add on that if position is -5 and i am in scene “MainGame1” then application.LoadLevel (“GameOver1”);

You want two things

  1. the && signs for AND

  2. the application.loadedLevelName

if(-5 && application.loadedLevelName == “…”)