Collision detection problem

Hello everybody, well I need to detect when the player touches a simple collider (I need this to change the level) but until now I just can detect when other objects collide, not the player.

This is the code I use:

function OnCollisionEnter (collisionInfo : Collision) {

if (collisionInfo.gameObject.tag == "Cube"){

    Application.LoadLevel ("GameOver");



I have already used the tag "Player" but it is not working,I have changed the tag, what tag shoud I use or what can I do to solve the problem??

Unity Script Reference: "In contrast to OnTriggerEnter, OnCollisionEnter is passed the Collision class and not a Collider".

Use OnTriggerEnter instead and compare the tags (don't forget to check "IsTrigger" on the BoxCollider or whatever Collider you are using.

function OnTriggerEnter (other : Collider) {
     if (other.CompareTag ("Player")) {