How to get the attack animation to repeat once I've attacked

I can cancel it back into Move but currently my Character attacks once and then gets stuck in the first frame of the attack animation. Everything continues to play fine except the animation.

I’ve looked for a Loop setting but can’t find it and not even sure thats the right thing to do. I also tried transitioning back to idle and then reattacking but the animation gets cut short

At the end of the attack, we should be transitioning back to the Move (locomotion) state, and then Fighter should be sending another SetTrigger to Attack again when the time between attacks has expired.

Try adding this immediately before the SetTrigger(“Attack”) (or whatever your trigger’s name is)

GetComponent<Animator>().ResetTrigger("Attack");
GetComponent<Animator>().SetTrigger("Attack");

By adding a ResetTrigger immediately before the SetTrigger, you guarantee that the Attack trigger is reset and should work correct.

Thank you, but that didn’t seem to work. It looks like it doesn’t step out of the Attack Animation in the Animator. So it just stays there and doesn’t retrigger anything because its still in the Attack state and there is nothing to retrigger

EDIT:

I fixed this by calling the Stop Attack Trigger at the end of the HIT code. I’m not sure if this will break anything in the future but for now it works. I then reset the trigger in Update before I call set Trigger again.

You should have TWO transitions from Attack back to locomotion… one uses the StopAttack trigger, and the other has no conditions and uses HasExitTime…

Privacy & Terms