Search Unity

Problems with animator state exit time.

Discussion in 'Animation' started by EternalMe, Nov 12, 2021.

  1. EternalMe

    EternalMe

    Joined:
    Sep 12, 2014
    Posts:
    183
    I find this behavior very strange. I have an character animation that is NOT looped. When its's played (transitioned) it gets stuck on last frame (what is expected) until some conditions are met to transition to next state. When those conditions become true it still hangs for some time on that last frame. Why?! When I remove exit time, it doesn't happen, but generates different problems for me (transitioning before played once to exit time).

    Ideally if a transition has been played to exit time and is hanging there (no loop) it should transition to next immediately when conditions are met. No?

    But it seems that even the animation is not looped, Unity still loops the time and waits for exit time :/
     
    Last edited: Nov 12, 2021
  2. KalOBrien

    KalOBrien

    Administrator

    Joined:
    Apr 20, 2021
    Posts:
    89
    You can address this by moving the exit time graph so it ends a little before last frame and transitions smoothly into the exit time condition.

    Its also good practice to call the animation change before the action/script/event
     
  3. EternalMe

    EternalMe

    Joined:
    Sep 12, 2014
    Posts:
    183
    I do not see how moving exit time graph could help with my problem (exit time being lopped despite non loop animation and being on last frame). Can you read again the original POST and try explain?

    I don't understand what you mean with calling animation change. Some example would be helpful.
     
    Last edited: Dec 5, 2021
  4. Radstronomical

    Radstronomical

    Joined:
    Mar 3, 2019
    Posts:
    5
    I am also having this issue. I have a condition controlled with the keyboard. When the condition is met, sometimes the animation hangs as if waiting to complete a loop, even though the animation is not looping. At first the animator progress bar was actually showing that loop time, I made some changes and it no longer visualizes it with the progress bar, but I can still feel the hanging animation.