- Home /
Mecanim Finish animation once but transition IMMEDIATELY on trigger
In Mecanim I want a ski jumper to animate a duck pose on key press and jumps once I release the same key. However I want the character to finish the duck animation prior to jumping, but to jump immediately as soon as I release the key and the duck animation has finished.
Mecanim states: Stand ---> Duck ---> Jump
Duck is "loop=false" and the Duck-Jump transition has the conditions:
Trigger: OnJump
ExitTime: 1.0
My problem is that apparently the animation-TIME still loops even though the actual animation-VISUAL doesn't so the transition only happens when the time is 1.0 every loop. If my duck animation takes 1sec and I release the key at 2.5sec it again takes another 0.5sec before the character actually jumps.
Some solutions I came up with:
Add animation events at the end of every animation which just set a trigger "AnimationFinished"
Make an additional state before the animation states which immediately transitions to the original state once the animation is finished and set the original state's animation time to 0. However this would bloat my animation states.
Answer by screenname_taken · Dec 03, 2014 at 04:38 PM
Just remove the exit time condition and it'll jump exactly the moment the trigger is ... triggered.
Yes, but the animation needs to run at least once. If I remove the exit time the character ducks a little bit and then starts jumping have way through.
Your answer
Follow this Question
Related Questions
Mecanim not updating script when it switches state? 2 Answers
RootMotion is not Working ... 0 Answers
Mecanim blend moves character? 1 Answer
Mecanim Bug: Bones inverted 2 Answers
Mirror animations in Mecamin 2 Answers