contactPoint.contacts problem

hello guys I got a racing game going on and I want the character to ignore the floor (its sort of a ship racing game like star wars episode 1) but mon contactPoint.contacts says that I have a null reference.

public Collision death = new Collision();
public Vector3 Floor = new Vector3(0.0f ,1.0f, 0.0f);
public float coll;

death.contacts[0] = new ContactPoint();
coll = Vector3.Dot(death.contacts[0].normal, Floor);

those are my variables and the initialization and here comes the code

void OnCollisionEnter(Collision death)
{
Debug.Log(coll);

if (coll < treshold)
{
Debug.Log(“BOB”);
Destroy(gameObject);
}

}

like I said it says that death.contacts[0] is null and I dunno how to fix it.

That’s not how you use OnCollisionEnter(). This is:

void OnCollisionEnter(Collision deathCollision) {
    angleFromUpCosine = Vector3.Dot(deathCollision.contacts[0].normal, Vector3.up);
}

deathCollision requires no initialization. It is a struct that you get to work with in OnCollisionEnter() itself.

(Also, please use the code tags.)

how do I use codes tags i,m not posting so much on forums lol