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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

2D Blend Trees: Linear speed and turning, how can i make this work?

Discussion in 'Animation' started by Nanako, Nov 11, 2015.

  1. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    Hi all .i'm trying to make a 2D blend tree, where the vertical axis represents a linear animation (walk/sprint/etc) and the horizontal axis represents a direction. I have two little turning on the spot animations that seem to blend quite well with the movement, and i cna make the wolf slowly walk in a circle, it looks neat.

    The problem, in both testing and practise, is that i can't get the angular nodes to trigger at any decent speed. On the little testing window, whenever the red dot is moved too far (vertically) from either turning node, the turning animations stop blending and it just runs forward.

    This doesn't really make sense, i was under the impression that they'd be active or not based entirely on the horizontal axis, and not on the vertical one.

    Here's a little example: (it's a large gif, click:)
    https://drive.google.com/file/d/0B0aQOsW6nXKgQ1NJVjk1dFRCaE0/view?usp=drivesdk

    The two centred nodes are walk and run respectively, their values are 2 and 5, which seemed like decent m/s thresholds for those animations.
    The nodes on the left and right, are the turning animations, they are on positions -1 and 1 on the directional axis.

    As can be seen in my example, the influence of the right turning node decreases as i move the red dot upwards.
    I would expect it to be at full influence when the direction axis is >=1, regardless of the speed (vertical) axis

    How can i get this to work like i expect? Am i using this wrongly?
     
  2. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    anyone?
     
  3. Asset-Ninja

    Asset-Ninja

    Joined:
    May 9, 2015
    Posts:
    13
    Same problem here! Hope we get any info.
     
    Nanako likes this.
  4. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    Have you ever tried doing this before? I remember doing it in the stealth demo project while i was learning unity. It worked fine then, but the character had a very narrow range of movement speed so maybe the problem just wasn't as obvious

    The documentation recommends using Freeform Cartesian as the type of tree for this particular purpose. I'm wondering if it's working as intended.

    It would be great if @Mecanim.Dev could chime in, and let us know if this is expected behaviour or not.
     
  5. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,887
    The Freeform Cartesian style blending has rarely been useful for me. Try sticking to the standard 1D. Split your left/right and forward/back movement.
     

    Attached Files: