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. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Mecanim Transition sometimes snaps, sometimes blends. Erratic behavior :(

Discussion in 'Animation' started by Aaron-Meyers, Dec 18, 2014.

  1. Aaron-Meyers

    Aaron-Meyers

    Joined:
    Dec 8, 2009
    Posts:
    301
    I've got a state in my animation controller that is setup like this:
    animation_controller.PNG

    shot02_float is a looping animation
    all the lean clips in the second blend tree are static poses, one frame each. that blend tree uses a 2D simple directional blend type.

    I use a trigger to transition straight to another animation. The transition looks like this in the inspector:
    transition.PNG

    So... it seems relatively straightforward to me, but I'm getting very erratic results. Most of the time there is no perceptible transition. If the character is in a position quite different from where the Fall starts, you can see a very abrupt snap to the start of the Fall. Sometimes though it works as I expect and there is a smooth transition over the first part of the fall animation. Sometimes its somewhere between -- I can see a transition but it happens way too fast the point of being hard to even see. So it seems like there is something causing the transition to happen either in 0 frames, just a few frames or the right amount of frames as far as I can tell.

    Can anyone offer any advice as to how I can get my transition to be consistently over the time period specified in the transition inspector?

    Does this have something to do with blending a looping animation with a blend tree full of static poses? I'm relatively new to Mecanim, but I thought I had a pretty good grasp of state transitions and blend trees.

    Would be grateful to get some advice on this! Thanks.

    -Aaron
     
  2. Aaron-Meyers

    Aaron-Meyers

    Joined:
    Dec 8, 2009
    Posts:
    301
    Ok... I have solved the problem. Not sure if it totally explains what the best practice is for a setup like this, but I had the animator re-export all the Lean poses to be 100 frames -- the same length as the Float loop -- and now I am getting consistent transitions every time, just as I want them.