How to stop playing the first animation and start the second one (Unity)

391 Views Asked by At

I have two animations. Punch animation and kick animation. I set up an Animator to transition between animations. If the first animation is playing, I want to interrupt it and start playing the second animation without waiting for the first one to finish. To enable animations, I use triggers. For example, a character makes a punch, and then immediately kicks. I've tried using boolean variables, but I'm unable to abruptly end the animation and jump to the next one. How to set up an animator?

1

There are 1 best solutions below

0
Sachem On

When you define your transition, there is a "Has exit time" setting that you may want to uncheck, or change "Exit time" to 0.

"Transition duration" is another setting that you may want to look into, perhaps.

enter image description here

To see those options in your Inspector, click on a transition arrow in animator window:

enter image description here