- Home /
What can interrupt a non-atomic transition in the animator?
In the documentation for animation transitions, it says if the atomic checkbox is checked, then the transition cannot be interrupted.
That said, I have 2 questions:
What can interrupt a transition?
If I make a transition atomic, do the actions that would have interrupted the transition just get discarded as if they never happened?
I have no idea when I should have the atomic checkbox checked, and it's because I don't know the answers to these 2 questions.
Here's a link to the docs for convenience: http://docs.unity3d.com/Manual/class-Transition.html
Answer by kacyesp · Sep 10, 2014 at 07:39 PM
After running into a 2 hour bug, I just discovered the answer to my questions.
Here's how that atomic button works.
Say I have 3 states: A, B, and C where A has a transition to B and B has a transition to C. So essentially I just have A -> B -> C.
If the transition from A to B is atomic, and in the middle of the transition from A to B the transition from B to C becomes true, then the transition to C will NOT happen. (This was my bug.)
If the transition from A to B is NOT atomic, and in the middle of the transition from A to B the transition from B to C becomes true, then we will happily transition to C.
In other words, if a transition in NOT atomic, you can consider yourself to already be at the state your transitioning to. If a transition is atomic, then all the transitions leaving the state you're transitioning to will be ignored because you're not completely at that state yet.
What can interrupt a transition?
Any transition leaving the state you're currently transitioning to.
If I make a transition atomic, do the actions that would have interrupted the transition just get discarded as if they never happened?
Yes, it's like they never happened.
"in the middle of the transition from A to B", the current state is still A, so the transition B to C could not be satisfied and happen.
true, this is especially useful with multiple layers and transitions from any state etc. Like if you have shooting and getting_hit on a new layer above your normal walking and jumping etc. And you can get hit and shoot any time and the transition can be longer than your shoot rate, you don't want to leave out getting hit animations and shooting animation
So what happens if A to B is atomic but also has Exit Time parameter at say, 0.5? Does C transition, then?
Answer by hu_amao · Oct 04, 2014 at 03:48 AM
1.What can interrupt a transition?
A: other transition from same state with higher priority.
2.If I make a transition atomic, do the actions that would have interrupted the transition just get discarded as if they never happened?
A: Yes.
// -- Explain below -- //
A state could contains several transitions, during the transition from this state, another transition from same state with higher priority could be satisfied and happen.
I tried a demo and it works: I have 3 states: A, B, C and 2 transition A->B, A->C, the transition A->C is higher priority than the transition A->B.
During the transition A->B, the transition A->C is satisfied, if transition A->B is atomic, the transition A->C would not happen, but if transition A->B is NOT atomic, the transition A->C would interrupt and replace the transition A->B.
Answer by ShawnFeatherly · Feb 19, 2015 at 02:23 AM
What can interrupt a transition?
Other transitions, according to http://youtu.be/JeZkctmoBPw?t=5m40s
Your answer
Follow this Question
Related Questions
Edit Animator Transition Conditions At Runtime 0 Answers
Animator event at the end of transition. 2 Answers
Animator State Changing but animation changes only after one animation is complete 0 Answers
2D animations transitioning too quickly and looping before finishing 2 Answers
Combining two animations to be one 0 Answers