- Home /
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
Answer by adrienPlayerium · Aug 17, 2017 at 05:53 AM
Hi @ExtinctChicken, easy fix, you need to add the "AnyState" set the transitions to the states you want.
Hi, could you elaborate your answer a little bit? I'm a little confused. You mean I add a transition from one attack anim to the other attack anim? That logically doesn't really work...
When you create an animator you got few default states: -Entry (in) -Exit (out) -Any State (you can use that one to create a transition from any state to another) I can't upload pictures for some reason it doesn't work sorry buddy