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