Help with on Collision Enter

I’m creating an asteroid game where you walk around, collecting crystals and if you get hit by a meteor, you die. For some reason unity doesn’t seem to be recognizing the collision. here’s the collision code.

function  OnCollisionEnter(meteor : Collision){
  if (meteor.gameObject.tag == "spaceRock") 
    { 
        Debug.Log("LostLife"); 
		lives--;
		transform.position = Vector3(0, 0.01858044, 0);
    }
}

thanks

Use the function OnTriggerEnter:

function OnTriggerEnter(meteor : Collider)
{
    if (meteor.gameObject.tag == "spaceRock") 
    { 
       Debug.Log("LostLife"); 
       lives--;
       transform.position = Vector3(0, 0.01858044, 0);
    }
}

Now you must try to set the collider of meteor to trigger and the the player must have a normal collider without trigger. Remember to set the tag to “spaceRock” in the meteor inspector.