How to setup this melee animation system in Mecanim?

Hi all,

I have a simple sword model with 2 very basic swinging animations that are played upon a mouse click. The animation transitions from the Idle state to the either of the two swinging animations. The problem I have right now is that when I click the mouse button multiple times, it would transition to the attack state, play the animation once, transitions back to Idle state, and then it swings again and so on.

Is there a way that I can transition to the other attack state without transitioning back to Idle state every time it swings? It looks quite funny on screen…

note: I use a random number generated upon mouse click to determine which attack animation would be played.

Here’s a screen shot in case I didn’t explain it clear enough

Hi @ExtinctChicken, easy fix, you need to add the “AnyState” set the transitions to the states you want.