AnimationState.AddMixingTransform

Can anyone explain AnimationState.AddMixingTransform abit more?
I’m having trouble understanding the way it works…
My main goal is to split the characters bones so the upper bones will run one animation while the legs will run a different…
I think thats the solution for it but I’m having trouble understanding the way it works.
It whould very help. (=
Many thanks.

The name is odd, because it does two things. the first time you use it, it limits the animation to only that bone chain (the bone you use, and kids.) The 2nd+ times you use it, on the same animation, it adds that bone chain. So, if you want both arms, AMixT(upperLarm) and AMixT(upperRarm) will do it.

To combine two animations, simplest way is to put them on different layers. The higher number wins, but it you split into upper/lower body, that won’t matter (you get first pick of the pizza, but hate crusts, and I only eat crusts.) Looks like:

animation["topRun"].AddMixingTransform("upperSpine");
animation["topAim"].AddMixingTransform("upperSpine");
// both are on layer 0
animation["bottomRun"].AddMixingTransform("lowerSpine");
animation["bottomRun"].layer = 5; // any > 0
animation["bottomCrouch"].AddMixingTransform("lowerSpine");
animation["bottomCrouch"].layer = 5; // any > 0

if( something) animation.CrossFade("bottomCrouch");
// stops other bottom (layer5) animation, leaves top alone, play crouch

if( something) animation.CrossFade("topAim");
// stops other top (layer0) animation, leaves bottom alone, play aim