Trying to Delete Object upon Collision

I've tagged my Cannonball's prefab with 'CannonBall' and I made this function to delete them when they collide. I added it to the prefab as well. Problem is, they don't delete. Any mistake in my logic? I'm pretty new to Unity. Thanks!

function OnCollisionEnter(collision : Collision)
{
    if (collision.gameObject.tag == "CannonBall")
    {
        Destroy(GameObject.FindWithTag("CannonBall"));
    }

}

You already have the reference to the object you want to destroy so there is no need to attept to find it.

function OnCollisionEnter(collision : Collision)
{
    if (collision.gameObject.tag == "CannonBall")
    {
        Destroy(collision.gameObject);
    }
}

Other than that, make sure that your cannon ball has a collider and that the tag of that colliders game object really is exactly "CannonBall".

If you would use GameObject.FindWithTag you might get "any" cannonball. Maybe not the one you collided with.

function OnCollisionEnter(collision : Collision) {
Destroy(gameObject);
}

place this in the canonball prefab, and if the canonball collide with something, it will be deleted!