Incorrect animation state being triggered, deadstate :(

Hi Everyone,

I have an animation of a character flying down, and then an automated exit that once the animation is completed, it will play the idle animation.

Both of these animation states have an animation trigger coming out of them, which makes the character fly back up. The problem arises when I call this trigger right before the automated exit trigger is called by Unity’s animation system. I can see it trying to trigger my fly up animation, and then it gets overridden by the automated transition exit.

The trigger that I call needs to be able to be called at any time when in either of these animations to make the gameplay feel smooth, which is why both of them have the trigger coming out of them.
There are no issues when I call the trigger soon in the first animation, or at any time in the second one, and when slowing down time, I can repro it nearly 100% when I call it right before it hits the transition trigger from Down to Idle.

I’ve attached the setup below with the parameters, and links to visualise it better:

Am I setting something up incorrectly? Because this really feels like a bug with Unity more than me doing something wrong, but I want to verify this setup makes sense, or if there is a more sensible approach to this.

  • All 3 transitions have interruption sources completely opened, so I allow every animation to take over if it so chooses (so I have more control in my code)
  • Only the fly down to idle transition has an exit time

Any help would be greatly appreciated, because this is causing quite a nasty deadstate :frowning:

shameless bump because I can’t find a nice solution for this :(. It’s deadstating in another area with a similar setup,

I really just want to understand if this is expected behaviour with the animator and my setup is wrong, or if it’s not expected and it is something that is a problem for other people.

The automatic state exit transition is taking place after calling another trigger coming out of it manually. How do I stop this from happening?

Good old reddit to the rescue.

So if anyone else finds themselves in this situation:

The interruption sources were set up incorrectly.

My manual trigger “FlyUpMainMenu”, should have its interruption source set to only next (or none, both are valid options in my case), which means that as soon as that trigger is called in flyDown or Idle, no other transition coming out of those states can be called.

my transition between flyDown and Idle should have current then next, so if the automatic transition is called, and then my trigger, it will prefer my manual trigger call.