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 and 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? It looks quite funny on screen…

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

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

Just add transitions from one attack animation to another. Or make transitions from “Any state” instead of Idle.