Search Unity

Mecanim Animator 1 frame lag

Discussion in 'Animation' started by funshark, May 22, 2014.

  1. funshark

    funshark

    Joined:
    Mar 24, 2009
    Posts:
    225
    Hello everyone,

    This is an issue some people have already reported but I've not seen any solution or explanation around... so i'm reposting it in the clearly possible way.

    It seems that Mecanim ( Animator ) has a 1 frame delay "between" any of its state changes ( correct me if I'm wrong )

    Practical example :

    $unity_animator_issue.jpg

    1: 1 frame to check / activate the parameter "grounded"( in this case, the Player is colliding with the ground )

    2: 1 frame to change the actual state ( Player_fall -> Player_walk )

    3: 1 frame to start the Player_walk animation


    So it's a 3 frames vs 1 frame
    Consequence : there is a tiny glitchy effect the moment the character is colliding with the ground. But this is actually happening on every state change.

    I would like to know if it's something we have to deal with ( I mean it is part of Mecanim/Animator ) or if this is a code optimization issue ( or maybe something else to look for )


    Thanks guys
     
  2. funshark

    funshark

    Joined:
    Mar 24, 2009
    Posts:
    225
    how the transition looks like

     
  3. LoftyTheMetroid

    LoftyTheMetroid

    Joined:
    Oct 26, 2012
    Posts:
    57
    I'm having the exact same problem in my 2D game. It happens even if I use Animator.Play(). It's particularly noticeable during instant transitions where the two states have dramatically different appearances/orientations. (For example, one of my sprites can appear upside-down for a brief moment...)

    Right now I'm just trying to hide the issue the best I can, and fortunately most people can't seem to see the 1-2 frame delay. But still, it's rather annoying...
     
  4. funshark

    funshark

    Joined:
    Mar 24, 2009
    Posts:
    225
    unity 4.5 seems to remove the step 2, which is a good new!