Enemy wont react to bullets

My enemy AI arnt reacting to my bullet prefab they both have box colliers and heres the code for when the zombie gets hit with the bullet

function OnTriggerEnter (other: Collider) {
    if (other.gameObject.CompareTag("Bullet")){
        moveSpeed = 0;

but the bullet just goes through the zombie and the zombie wont do anything what am I doing wrong? (Yes the bullet object has the Bullet tag)

Unless your colliders are marked as triggers, this won’t work.

You need to use OnCollisionEnter

For moving objects, such as zombies, you don’t want to use triggers anyway.
You would use triggers on stationary objects such as doors/traps etc.

If that doesn’t work, try firing some nukes, that might get a reaction out of them :stuck_out_tongue:

I never thought of makeing the colliers triggers >.< lol thanks for the help it worked!