- Home /
Why does this animator appear to occupy two states, but report only one?
I'm trying to animate a door that opens and closes on entry and exit of a trigger, respectively. If a trigger enters before the closing animation finishes, the door reverses, returning to the open state.
While the animation looks right - if a trigger enters before the closing animation finishes, the door re-opens - the animator continues to report (in code) that it is in the "closing" state, long after the trigger has prompted it to return to the "open" state.
Meanwhile, in the Animator view, it appears that the "closing" state continues (the blue bar below the state name keeps filling) even as the "opened" state runs (same there). Screenshot below:
It appears to remain in the "closing" state for as long as the duration of the animation (6 seconds, in this case) in addition to the time it had already spent in that state. So if the trigger enters at second 5 of the "closing" state, the code and the Animator view to report that it is in the "closing" state for another 6 seconds, for a total of 11 seconds.
Is this expected behavior? What can I do - if anything - to get the behavior I expect: a transition from the "closing" to "opened" state upon a trigger?
Additional info: the two transitions from closing are on exit time (to the "closed" state) and a trigger (to the "opened" state). The transition to "opened" has a higher priority than the transition to "closed". Neither are atomic.
Your answer
Follow this Question
Related Questions
Accessing AnimationState in Animator 0 Answers
Get an Animator state inside an AnimationEvent callback of the last frame 2 Answers
Mecanim and Ragdoll Issues? 2 Answers
Problems with Animator(Mecanim) 1 Answer