Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Resolved Transitions starting in random poses when using various sub-machines

Discussion in 'Animation' started by carcasanchez, Mar 8, 2021.

  1. carcasanchez


    Jul 15, 2018
    Hello, fellow Uniters. I have lately run into a very strange issue with a complex animator, where I have various sub-state machines.
    The idea is simple: I am in a substate machine, doing a cycle of random animations, until a trigger is set and I jump to another state.
    But something is happening to transitions. Sometimes, when the trigger is set, the transition is done nicely. But the rest of the time, the rig "jumps" to a completely random pose, and then make the transition.
    It's very strange, because the transition is indeed happening, but not from the expected pose.
    I presume this is happening due to a bad configuration, where it somewhat stores some previous pose, and doesn't get to clean it when making another transition.
    But I can't put my finger on why this is happening, it's the first time I see this behavior.
    This is the animator main tree, with a random transition selected:

    And this is one of the sub-machines (the exit transitions have just "has exit time" activated with no conditions). When a sub-machine finishes, if no trigger has been set, a script selects a random number, and the sub-machine transitions to itself, but in a different state. This seems to work always fine.

    This is an example where everything works fine:

    But after a while, transitions start to get choppy:

    See that, before making the transition, the pose jumps to something completely random?

    I initially thought it could be a problem of trying to run a transition while already doing one, but I changed the Interruption Source and make sure I was not in the middle of any transition and still happening.

    Any hint on what the problem could be?
  2. carcasanchez


    Jul 15, 2018
    Solved! The culprit here was the Cycle Offset, which was linked to a random parameter we set each time a state was entered. That's why the behaviour was, indeed, inconsistent.