How to load a scene on collision

I need to know how to Load a scene named, UnityZombieGameScene3 on collision.
Please say if its on the collider or the character that will be colliding with it, I would prefer the script to be in Javascript, its ok if its not. Thanks

function OnCollisionEnter(col : Collision) {

  Application.LoadLevel ("UnityZombieGameScene3");

}

You can also add a check to see if it collided with the right object (e.g player).
This script can go on either the character or the other collider :slight_smile:
Bet you could have figured this out on your own though…

Here’s some Boo, just cuz’ .

If it’s not correct, I don’t care, I don’t use that language. I put more effort into making this into Boo than you did into finding an answer to this question or figuring it out in any way.

import UnityEngine
import System.Collections
class CollisionLevelLoader(MonoBehaviour):
   def OnCollisionEnter(other as Collision):
      if other.gameObject.CompareTag('Player'):
        Application.LoadLevel('UnityZombieGameScene3')