Problems with 2D Collision

I dont know if its because I use sprites, I want to make a prefab destroy itself when colliding with a sprite with tag “Barrier”, they have Rigidbody2Ds, Box Collider 2Ds (with IsTrigger true) , same Z and they still dont collide. Can anybody identify what’s wrong?

public class ShootScript : MonoBehaviour
{
    void OnCollisionEnter2D(Collision2D coll)
    {
        if (coll.gameObject.tag == "Barrier")
        {
            Destroy(gameObject);
        }
    }
}

If you want to register collisions, you need to set isTrigger false.

Set IsTrigger false.If enabled, this Collider is used for triggering events, and is ignored by the physics engine.

The script where the code is written must be applied to any of the gameobject on which collider2D is attached and the Trigger set to false. @Gunging