Animation sometimes not working

Hi. I wonder if you can help.

I have a collision that is sometimes not working and sometimes working perfectly. I am getting my Debug every time so the if else is working, and both the animations play some of the time. Here is my code.

private void OnCollisionEnter(Collision objectHittingTheZombie)
    {
        if (objectHittingTheZombie.collider.tag == "ammo")
        {
            randDeath = Random.Range(0, 2);
            if(randDeath == 0)
            {
                anim.SetTrigger("death01");
                Debug.Log("Death 1");
            }
            else if(randDeath == 1)
            {
                anim.SetTrigger("death02");
                Debug.Log("Death 2");
            }
           
        }
    }

I have transitions set to zero and a rigidbody set to continuous collisions

Thanks everyone

Anh

This might be a stab in the dark, you could try using anim.Play(“string”) instead and see if you get more consistency on each iteration the script is called.