Preventing AnimationEvent during State Transition
✍ Last Updated : September 21, 2022
🚪 Prequisite Knowledge (Optional)
- Using Unity Animator
- Using Unity State Machine Behaviour
❓ Key Question / Problem / Issue
In Unity Animator, when the animator is transitioning from one state to another, during the transition time, any animationEvent that is inside the transition timespan will always be fired, this is something that not always desirable.
Animation Event in green must be called, but animation event in red must not be called
✅ Expected Output/Definition of Done
There should be option/ways to prevent the animation event from firing when animator is transitioning to another state
🎁 Resulting Solution
There are several approach tried when preventing animation event from firing when animator state is in transition, each has their own pros and cons :
[Preventing AnimationEvent during State Transition By Changing AnimationEvent Time](Preventing AnimationEvent during State Transition be45563c98054d22a7337266d5246b82.md)
[Preventing AnimationEvent during State Transition by not using State Machine Behavior](Preventing AnimationEvent during State Transition 0a9e4848ef1e4da68614dffb7a08f42b.md)
[Preventing AnimationEvent using Animator IsInTransition flag](Preventing AnimationEvent using Animator IsInTrans 472d9057dcbe422c86543e5eac2a03e7.md)
No Comments