Collider wont collide. But I have done everything correctly.

So I’m pretty sure there is 0 reason for this to be happening but I’m making a top-down shooter and I have an enemy which has a box collider 2D attached to it and I have a projectile that has a circle collider 2D and a Kinematic Rigidbody attached to it. I have tried to add a mesh collider but that didn’t seem to do much. I’m using the OnTriggerEnter2D function with the colliders set to ‘Is Trigger’ but the projectile just passes through the enemy and doesn’t do anything at all. I have done everything correctly that I’m aware of but it just won’t work. This code below is attached to my Enemy and it should destroy the enemy apon contact with the projectile but it dosnt :(.

 private void OnTriggerEnter2D(Collider2D other)
        { 
    if (other.CompareTag("Projectile"))
                {
                    Destroy(gameObject);
                    Destroy(other.gameObject);
                }
            }

I would add a Debug.Log() in your OnTriggerEnter2D() to see if you are even getting in there and if you are, then log the tag of the object as well.

Make sure that the name of your tag and the tag “Projectile” are the same case. (i.e. upper-case ‘P’, the rest of the letters lower-case.

Aside from that, and it is not obvious from the code snippet itself, is to look at the layers that your objects are on and look at the physics layer interactions (Edit > Project Settings > Phyiscs 2D) to see if the interaction between them is un-checked.