In Unity’s animator controller triggers that are set remain set until they are used by a condition. If the current animator state does not immediately handle that trigger, the trigger is handled in whatever later state does handle that trigger, even were it minutes later.
I request Unity adds a new type of trigger called an immediate trigger, that set until used by a condition OR one Animator update passes, essentially aborting the trigger if not immediately usable.
Examples where one might reasonably use some kind of trigger to start an animation
- Took damage
- Died
- Salute the player when the player walks nearby
- Attempt to play an attack
In all 4 of these cases, it’s easy to think of real-world scenarios where would be better to abort the trigger than use it at some time potentially minutes later. For example, if a character is in a dying state, and is given the salute trigger by unrelated movement code, the salute should be aborted, not played after the character is respawned.
In developing Empire of Ember over 4 years, there is literally not one time I wanted a trigger that uses the current implementation. There however are many times where I wanted an immediate trigger, and had to instead use a boolean that I set for one frame through code or use a trigger that I reset myself. It makes the code even more complicated than it already is.
I hope this feature request is looked at by the developers and doesn’t just get ignored. Thanks!