Negative Values in Direct Blend Tree broken?

I don’t know if I’m doing something wrong or if direct blends in mecanim are simply unable to use negative values. I have a direct blend tree animation made with three 1dimensional blends trees (Zmovement, Xmovement, Turn). The three sub-layered blend trees all have negative values in them (i.e. speed is 1 for forward, 0 for idle and -1 for backward). My AI needs these values to control it properly. This setup seems to work fine as long as the values are positive numbers. Anything below 0 on any of the three sub layers freezes animation altogether. So I can’t back up, I can’t strafe left and I can’t rotate left.

Or is there a better way to be able to control animation with three parameters at once?

1 Like

A hacky solution would be to add 1 to every value - 0 for back, 1 for idle, and 2 for forward.

Not pretty (you can’t just take the sign of the character’s velocity), but easy to implement.

BlendTrees should take negative values, are you sure Zmovement and Xmovement are floats? And have you set the motions at -1 correctly? If you select the GameObject, do the blue progress bars show anything stopping when numbers hit negative?

I think this is just how the Direct type of blend trees works. Bummer because it seems like it would work so easy.

@Baste , first off my AI needs zero to be the neutral point, but even if I do increase the values above 0 any adjustments of the slider toward zero slowly phase out all animation. So even if I have backwards motion at zero when I get to that value all animation of that parameter is completely stopped.

At SomeGuy22 yes in any other blend type (1d, 2d freeform Cartesian, etc) these negative values work perfectly. I definitely have them set up so that they would work beautifully individually. In fact if I have any sublevel tree selected in the animator window and preview the animation it works great by adjusting the sliders both above and below zero. Once I select the parent blend, preview the animation and adjust the values Everything stops at zero or below for all values. and yes the blue progress bare continues like nothing is wrong.

1 Like