Avatar Masks and Blending Layers

Hey all. I’m new to avatar masks and I’m having an issue with switching between layers. Immediately going from a layer weight of 1 to 0 is causing my player character to snap back into an idle animation.

Basically, when my player has a shotgun and is walking, I set the layer weight with the mask to 1. When the player isn’t walking, I set it back to 0.

I don’t know the appropriate way to transition smoothly between layers. Any help would be appreciated. Here’s the simple logic I’m currently using:

 if(anim.GetBool("hasShotgun") && anim.GetBool("isWalking"))
        {
            anim.SetLayerWeight(1, 1);
        }
        else if(anim.GetBool("isWalking") == false)
        {
            anim.SetLayerWeight(1, 0);
        }

Should I decrement the layer weight gradually?

You might be interested in my Animancer plugin (link in my signature) which includes a function to fade layers over time. I have no idea why Mecanim doesn’t have it built in. I’ve never actually tried fading layers over time when using Mecanim, but doing it manually could indeed do what you want.

I might try that, thanks.