Play an animation just on some parts of the body

I know that I can use layers to set animation prirority and AddMixingTransform to just set animate some parts of a mesh. Unfortunately, it doesn't really work. Everytime I want to crossfade to the walkanimation(that just animates the legs) it also fades the idle animation out but it should keep playing "Idle" and should just overwrite the animation of the legs. What is wrong with the script? I can't find something I miss there

void Start () {

Animationen["Idle"].layer = 2;
Animationen["Walk_Weapon"].layer = 2;

Animationen["Walk_Weapon"].AddMixingTransform(RightLeg, true);
Animationen["Walk_Weapon"].AddMixingTransform(LeftLeg, true);


// Update is called once per frame

void Update () {

        if (Input.GetAxis("Vertical") > 0.2)
            Animationen["Walk_Weapon"].speed = 1.5F;

        if (Input.GetAxis("Vertical") == 0 && Input.GetAxis("Horizontal")==0)
            if (IsWeaponMode())


In the scripting reference, CrossFade is defined as:

function CrossFade (animation : string, fadeLength : float = 0.3F, mode : PlayMode = PlayMode.StopSameLayer) : void

I might be way off, but notice the PlayMode.StopSameLayer. The default behaviour is to stop all the rest of the animations in the same layer, and the other option is to stop the animation on all layers... So either make "Idle" and "Walk_Weapon" on different layers (this might cause you problems if you want to sync them later on), or try and use Animation.Blend instead.

I'm sorry - I don't have time right now to test your code out. I'll try and check in later if you still have a problem...