- Home /
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.
Answer by Owen-Reynolds · Sep 01, 2011 at 07:54 AM
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
Your answer
Follow this Question
Related Questions
First Person Legs. 3 Answers
CrossFade/Blend Additive Animations? 5 Answers
Character assets bundles problems on skinned mesh 1 Answer
Animations: just making sure my workflow is right. 1 Answer
Allow translation data on joints other then the root? 0 Answers