Script cannot detect collision

I’m using the function OnCollisionEnter2D to detect whether or not a gameObject has collided with anything. In the case that it does, the gameObject should destroy itself. It doesn’t work, instead the gameObject flies by and through everything. Here is the code for the function:

void OnCollisionEnter2D (Collision2D coll)
    {
        Destroy(gameObject);
    }

I have no idea what’s wrong with this thing. Any help would be greatly appreciated

Nevermind, just used OnTriggerEnter2D. Still not sure why collider didn’t work though…