#pragma strict
var maxFallDistance= -10;
function Update ()
{
if(transform.position.y <= maxFallDistance)
{
LoadLevel();
}
}
function LoadLevel ()
{
if(Application.loadedLevelName == ("Level1"))
{
Application.LoadLevel("Level1");
}
}
#pragma strict
var maxFallDistance= -10;
function Update ()
{
if(transform.position.y <= maxFallDistance)
{
LoadLevel();
}
}
function LoadLevel ()
{
if(Application.loadedLevelName == ("Level1"))
{
Application.LoadLevel("Level1");
}
}
Try using this if(Application.loadedLevelName =="Level1")
(Remove parenthesis). If you are using unity 5.3 try using Scene manger.For more info about scene manger follow this unity docs link - Unity docs Scene Manager
Hope this may help you.
Nsks