My bullet script doens't work.

my scripts doesn’t seem to be working. Even though I use tags. My bullet is a prefab. I added a collider for my enemy and made it is trigger. I don’t know why it doesn’t work. also my prefab’s tag is bullet too.

{

public float Health = 10;
public float CurrentHealth = 10;
public float MinHealth = 0;

void Start()
{

}

void Update()
{
    if (CurrentHealth < 1)
        Destroy(gameObject);
}

void OnCollisionEnter(Collision collision)
{
    int Damage = 5;
    if (collision.gameObject.tag == "bullet")
    {
        CurrentHealth -= Damage;
    }

}

}

in void OnCollisionEnter(Collision collision) add Debug.Log(collision.gameObject.tag); Then you will see if it is colliding. Another issue could be that your bullets are moving too fast that it’s missing the collision. You can fix by making collision continuous in the inspector, using raycasts instead or slowing down your bullets.