- Home /
Unity animator state finished, motion not
Example:
Screenshot of the TopAppearing motion - boost the alpha of the sprite from 0 to 1 for total of 2 seconds.
Screenshot after TopAppearing state has been finished
Screenshot of the TopAppearing's transition settings
Question:
Why isn't the alpha of the Top's sprite 255(1) after the TopAppearing animation state has been finished?
Answer by glhfGreg · Nov 18, 2015 at 10:32 AM
It looks to me like the exit time on the transition is causing the issue. You have it set to 0.5 which means it will start transitioning when TopAppearing is executed halfway likely causing it to never quite finish.
it's true, I coudn't understand the reason why it would not finish, though. What is causing the animation to not finish?
A transition blends one animation state into another one. Consider a walking animation blending into a running one. The transition causes it to gradually do less of the walking and more of the running. The same happens in your case: it starts doing less of the TopAppearing animation and more of the TopTextAppearing animation. If you want to make sure an animation is completed before transitioning to the next one, an exit time of 1.0 is needed.
I'm guessing you want the TopTextAppearing state to start while TopAppearing is executing. In this instance it would be better to make two animation controllers each controlling one game object. This way the animations would be independent of each other and you could time them as you wanted via code. This tutorial on animating the UI (is applicable to your 2d animations) might help you out: http://blogs.unity3d.com/2014/06/30/unity-4-6-new-ui-world-space-canvas/.
The example with the walking- running animations was great and very easy to understand. Now I know that this is just how unity works. Thanks!
Your answer
Follow this Question
Related Questions
Can I make animations snap to a frame? 1 Answer
How to make 2D Sprite Animation frames spread over the duration of the motion time 0 Answers
Why have some of my prefabs and animations files gone blank?? 1 Answer
Character Doesn't Animate Properly When Stopped 0 Answers
Change animations associated with an animator from C#? 0 Answers