Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

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.
     
    Klausbdl likes this.
  5. Klausbdl

    Klausbdl

    Joined:
    Aug 12, 2013
    Posts:
    69
    bump
    Having the same issue and Idk how to fix it. Even tho the transition looks like this, it plays a whole lot more (red line) before exiting the state.
    Captura de tela 2024-05-07 114303.png

    Edit: I just checked, I have the exact same setup in another part of my Animator and it works as intended for some reason
     
    Last edited: May 7, 2024