Mecanim when call setTrigger, plays next clip twice

I am working on a simple 2D matching game. The facedown state is a simple animation that is 1 second long and loops. The idle state is for the card when it is face up. A 2 second animation loop plays here for the character on the card. The flip state is an animation that rotates the card, simulating a flip.

I have a simple state machine:

20763-statemachine.png

Transitions:

  • faceDown → Flip transition when the
    flipTrigger(Trigger) event is called
  • Flip → Idle transition on Exit and
    if isFaceDown(boolean) = false
  • Idle → Flip transitions when the flipTrigger event is called
  • flip →
    faceDown transition on Exit and if
    isFaceDown = true

The problem though is that from both the faceDown and Idle states, when I call the flipTrigger, the flip state actually plays through the animation twice.

Loop Time for the flip animation clip is toggled off.

I’m really at a loss here. Any help would be much appreciated!

Thanks!

@LeandroExHuMeD hopes this helps :slight_smile:

Here is the run animation running 2 times. 1 time of its full length, and one time with the starting bit, where it transitions over to the death animation.

Here is the exit Time set to a little under 1 and transition duration set to 0 that means that the run animation only will run 1 time of its full length and then go to the next animation.


:slight_smile:

Just spent literally two hours trying to find out the answer to this. Here’s what was going on with me:

I had two states: Fire and Idle. Under the transition between Idle → Fire, there was a gradient. I had to scroll to the right (hold middle mouse button and drag). Fiddle with that, and you can adjust the timing, how many times each animation plays during the transition, and so on.