- Home /
RemoveMixingTransform function?
With AddMixingTransform, I can set specific transforms, that affect the animation. But is it possible to remove the set transforms? Because if the character holds a weapon, the animation "Walk" should only affect the legs and if the character is unarmed, it should affect the whole character.
if(Animationen.IsPlaying("ArmedIdle")){
Animationen["Walk"].blendMode=AnimationBlendMode.Additive;
Animationen["Walk"].AddMixingTransform(RightLeg,true);
Animationen["Walk"].AddMixingTransform(LeftLeg,true);
Debug.Log("Additive Mode");
}
else{
Animationen["Walk"].blendMode=AnimationBlendMode.Blend;
Animationen["Walk"].AddMixingTransform(StartBone,true);
Debug.Log("Blending Mode");
}
Answer by Owen-Reynolds · Apr 26, 2011 at 01:41 AM
Not really an answer, but I'd keep the walk animation always on legs only, and give the top of the body an "unarmedIdle" animation. Depending, you might be able to reuse the same frames from walk.
Seems, that I have to split all animations to a legs and top-body part. I've tried it with an basic walk-forward and ArmedIdle animation and it worked. It's just a little bit complicated to control right but at last, it works :D
Answer by Paulius-Liekis · Apr 25, 2011 at 09:21 PM
RemoveMixingTransform function doesn't exist, so you have to create a new animation state. There is a feature request for that.
Should be available in 3.4 if everything goes well :)
Answer by DaveA · Apr 25, 2011 at 07:15 PM
I've not used this, but it sounds like the kind of thing you'd set up in Start, then use (or not). If you are not using it, set the transform to identity, seems like it would then not affect what it's attached to (??)
I've tried this, but it didn't work. It keeps all transform I've set, so it just adds zero to them.
Your answer
![](https://koobas.hobune.stream/wayback/20220613125233im_/https://answers.unity.com/themes/thub/images/avi.jpg)