How Do I change the scene when my character falls into the ocean?

Hey guys,
I’m creating a game and when my first person controller reaches the ocean the scene doesn’t change to the lost screen. Please help me!

Heres my script which I attached to my first person controller

function OnCollisionEnter(myCollision : Collision) {

if(myCollision.gameObject.name == “Floor”)

{

Application.LoadLevel(“Lost Screen”);

   }

}

,

Why don’t you use :

function OnTriggerEnter (otherobj : Collider){
if(myCollision.gameObject.name == "Player"){
Application.LoadLevel("Lost Screen")
}
}

I don’t know what the difference is between a trigger and a collider, but I usually use triggers. Also make sure the object you call Floor has at least a collider. If it still doesn’t work try adding a rigidbody to one of the two object. And another problem, you made your player the trigger, not the object you’re supposed to touch. Most people want their player to touch multiple triggers. So just to summarize it for you:

  1. Use triggers instead of collision
  2. Attach your trigger to the object you want your player to react with, not to the player itself
  3. Make sure both objects have a collider, probably a mesh collider but another shape is possible too
  4. If it still doesn’t work, give your player a rigidbody component