Bullet won't collide with enemy

I have two objects; an enemy object and a bullet object. They both have 2Dboxcolliders and 2Drigidbodys and the bullet object has ‘Is Trigger’ set to true.

In the enemy script I have the following based off of a tutorial:

private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.CompareTag("Bullet"))
        {
            sr.material = matwhite;
            Debug.Log("got shot");
            Destroy(collision.gameObject);
            health--;
            if (health <= 0)
            {
                KillSelf();
            }
        }
    }

When making contact with the enemy however, the bullet will just go right through and not collide at all,

I have checked that the bullet does have the bullet tag, I’m not sure what is causing the problem since it seems to work well enough in the tutorial i am following and i am pretty sure i have everything else the tutorial needs. However if there is another fairly straightforward way to fix my problem apart from this am open to suggestions.

“the bullet object has ‘Is Trigger’ set to true”

If you have OnTriggerEnter on the Enemy then the enemy is the trigger, not the bullet. You’d need the enemy IsTrigger to be true, and the bullet’s IsTrigger to be false.

It almost seems like you think OnTriggerEnter means “When a trigger enters me”. But that’s not the case it means “I am a trigger, and when something enters me I do something.”

Me personally I would change this to put the OnTriggerEnter on the bullet, then when the bullet enters the player apply your damage to them and kill the bullet.

Set Bullet’s rigidbody collision detection mode from “Discrete” to “Continuous” inside the inspector if the bullet travels very fast.