fixed

Updated on June 27, 2017 in  [R] Scripts
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
2 on June 17, 2017

this should respawn the player when he fall but it does not do anything and there are no errors (unity5.6)

 

#pragma strict

 

var maxFallDistance = -10;

 

function Update ()
{
if (transform.position.y <= maxFallDistance)
{
Application.LoadLevel(“level01”);
}
}

  • Liked by
Reply
1 on June 20, 2017

I don’t think there is anything wrong with your code in terms of your if statement, According to the unity documentation —> “Before you can load a level you have to add it to the list of levels used in the game. Use File->Build Settings… in Unity and add the levels you need to the level list there. “, Have you done this??

on June 27, 2017

no i forgot to add this to the player

thanks btw

Show more replies
  • Liked by
Reply
Cancel