destroy gameobject when collider is fast enough?

Hey there,
i’m searchin for a solution for the following:

I want to destroy a GameObject on collision, but only when the other collider is fast enough.

For example if a car with low speed hits a tree, then the tree should not break. When the car is fast enough the tree should break/destroy.

How can i quantify the speed of a collider?

Hope you guys know what i mean.

Code could look like this:

public float speed;

void OnCollisionEnter(Collision collision){
     if (collision.collider.tag = "Car" && speed >= 10)
    {
     destroy(gameobject);
     } else {
     debug.log("Not fast enough");
     }
}

Sorry for bad english.

Greets

That should help you.

The car should have a speed. if it is public you should be able to reference it via collision.gameObject (Unity - Scripting API: Collision.gameObject)
then all you need to do is… (sorry not at my dev PC right now) but it would be basically something similar to this.

void OnCollisionEnter(Collision collision){
    if(collision.gameObject<Car>())
    {
       if (collision.gameObject<Car>().Speed >= 10)
       {
           destroy(gameobject);
        } 
        else 
        {
            debug.log("Not fast enough");
        }
    }
 }