Need help with damaging enemy.

I’m using simple projectile as my bullet. I’m now trying to use the weapons damage as the method to reduce enemy health. Here’s my starter script:

using UnityEngine;
using System.Collections;

public class Zombie : MonoBehaviour {

    Collider other;
    WeaponStats weapon; 
    GameObject bullet;
    Animator anim; 
    public int enemyHealth;
    bool playerinrange;

    void Start ()
    {
        weapon = GetComponent<WeaponStats> ();
        other = GetComponent<Collider> ();
        anim = GetComponent<Animator> (); 
        bullet = GameObject.Find ("bullet");
    }


    void Update()
    {
        Attack ();
        TakeDamage ();
    }
   
    public void Attack()
    {
       
    }

    public void TakeDamage()
    {
        if (other.tag == "bullet") 
        {
            enemyHealth = enemyHealth - weapon.damage;
        }

        if (enemyHealth < 1) 
        {
            DestroyObject (this.gameObject);
        }
    }
}

My weapon is setup using inheritance. Weapon Stats > Shot type > Weapon

I cannot get the enemy to reduce health when the two colliders meet.

You don’t have an OnCollisionEnter function at all.

public void OnCollisionEnter(Collider other)
    {
        if (other.tag == "bullet") 
        {
            enemyHealth -= weapon.damage;
            Destroy (bullet);
        }
   
        if (enemyHealth < 1) 
        {
            DestroyObject (this.gameObject);
        }
    }
}

still no luck.

OnTriggerEnter worked…

Do both objects have collider? Is on collider actually a trigger? How fast is the bullet moving? If it is moving too fast then it may fly past the enemy in a single frame, resulting in the collision to be not caught.

If OnTriggerEnter worked then one collider is a trigger not a collider.