I am currently working on a Beat 'em Up style game, and wanted to set a trigger on mouse1 down to perform a punch using SetTrigger, see code snippet bellow:
if (Input.GetButtonDown("Fire1"))
{
isAttacking = true;
if (vertical != 0 || horizontal != 0)
{
vertical = 0;
horizontal = 0;
animator.SetFloat("Speed", 0.0f);
}
animator.SetTrigger("Punch");
}
Problem is that the animator.SetTrigger does not recognize the animation name i have given it, and states it is missing that component.
Thank you all.
The answer to the above issue is to name the trigger parameter in the Animator the same thing I named it in the c