Search Unity

Problem with Blend Tree and animation

Discussion in 'Animation' started by giotta, Jan 17, 2021.

  1. giotta

    giotta

    Joined:
    May 31, 2015
    Posts:
    48
    Good morning, I have a question to ask about unity's blend tree animator. I bought a package of animations from the asset store containing the classic animations to shoot the character 90 and 180 degrees, respectively right and left. When I go to do the blend tree of these animations, with the idle state, in one of these 4 animations, I don't know why, for some animation frames, my character changes direction for a few moments, and then back to the correct position. Is it possible to be a problem in animation? Does anyone have any idea why with 3 animations it works perfectly, while in one does this artifact ?
    I don't really understand what the problem might be
     
  2. giotta

    giotta

    Joined:
    May 31, 2015
    Posts:
    48
    Does anyone have any idea? Why do the two animations (taken individually) work well, and once mixed they produce that artifact?
     
  3. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    it is probably the root transform rotation that causing it. if character is looking left, usually the root (hip) rotation is different than looking right. if you want blending without root rotation changing, character should have same orientation.

    try baking root transform rotation (and adjust offset if needed) see here
     
  4. giotta

    giotta

    Joined:
    May 31, 2015
    Posts:
    48
    In the meantime, thank you for your answer. I tried to lift the V on Bake Into Pose(under Root Transform Rotation) and the artifact disappears. I noticed, in the file called Root in the animation, on Rotation x=-89.98 and in all other animations it is -90. Is that the problem? Is it a root import problem in the animation? Out of 25 animations, only in this one gives problems when used in blends. Thank you again and sorry for my bad english
     
  5. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    I have a feeling this has got to be because of the interpolation, and if I get it right, it always takes the shortest path (smaller angle)
    more about this here

    experimenting with the root transform rotation offsets should give some values that work
     
  6. ChronosDecay

    ChronosDecay

    Joined:
    Sep 27, 2023
    Posts:
    1
    I have a similar problem. My player is a ship that moves just in the x axis. Then, after I setup the animations in the Blend Trees, I realized that when the x axis is 0, the animation plays the left turning animation, what makes it plays always when I stop move the player. Right after that, the idle sprite is show. I still didn't figure out how to solve this.
     
  7. ValkyrieAnim8

    ValkyrieAnim8

    Joined:
    Aug 7, 2023
    Posts:
    7
    have you checked your animation curve input settings and made sure that "unroll" is on so that you don't get axis flipping due to large rotation glitches that can happen due to gimbal lock in DCC