attack in 3rd person controller

I am working with unitys 3rd person controller and I am a little new to working with combat what would I have to do to make it so that the script they have on it makes it play the attack animation when I press the “A” button?

1 Answer

1

Create the attack animation, name it attack. Then add this code in update

if( Input.GetKeyUp( KeyCode.A ) )
    animation.Play("attack");