How to make an enemy recognize a bullet

i have tried to make a trigger collider around the enemy, but it won’t always recognize the bullet. how else can i do this?

Do something like this for finding out which object you have hit, read the comments as this won’t just cut and paste due to the raycast parameters used in this example.

function subDetect_Bullet_Hit() {

    var hit : RaycastHit;
    var oOther_Object : GameObject;
    
    //These parameters are from something I did, not instantly transferable to your project and needs
    if (Physics.Raycast (transform.position, transform.forward, hit, fRaycast_Distance, lmPlayer)) {
        
        if (hit.collider.gameObject.tag == "Your_Target_Object_Tag") {
        
            //Do you what you want now you know it has hit what you want.
            
            //You can store this gameobject, find its components and scripts etc,
            //and do whatever you need with it, inc destroy it.
            //Store like this :
            oOther_Object = hit.collider.gameObject;
        }
    }
}