Hey, I wonder if some more experienced folks are willing check me on this because I am driving myself absolutely insane trying to get animation layers working with an avatar mask. what i have TRIED to do, and failed, is to get a base layer working with standard basic motions for movement, then added a layer for weapon specifics (i.e. to hold a rifle). The avatar mask is currently set with everything above the legs green, legs and below off (red). I turn the layer on (weight = 1) when I equip the weapon. The problem is that no matter what i do, it twists the character at the waist so they are no longer holding or facing the forward direction. How far off it is seems to be dependent on the animation (a standard Mixamo animation is off by as much as 45 degrees, a decent MoCap Online animation only a few degrees off but still noticeable). Sometimes the base layer movement animations go screwy as well with weird twitches and hip gyrations when the character walks/runs (again, seems dependent on the underlying animations).
SOME of the things I have tried:
root motion transform settings have ZERO effect on the outcome, honestly the settings seem to get completely ignored when you use an avatar mask. I have tried tuning the chest and head off/on on the mask…no help there. I have tried turning the GROUND on the mask off/on that sometimes helps to get the arms facing the right way but the head and chest go screwy and that also seems to mess up the leg animations more often. Nothing I do seems to work to get the animations to play nice together if there is a mask and layer involved.
What I have resorted to:
Out of utter frustration with this whole damn problem and a desire to make some forward progress on the game I have resorted to an animation controller with NO layers and all the same basic movement animations and then a separate Animation Override Controller for each weapon type. When I swap weapons, I swap what override controller I am using. This WORKS but as you can imagine is bit of a maintenance nightmare and honestly feels a bit brute force and inelegant to me.
So the question(s) I really have here is… do most people use a controller and override controllers the way I have described or is there some secret recipe sauce that I am just too stupid to find which gets layers and masks working smoothly with these animations? Any advice or thoughts you might have would be greatly appreciated before I toss my computer out the window is a blaze of frustrated ignorance.
Bumping this for any input from some more experienced folks on my solution to the animation problem. Good / Bad? Or any thoughts on how to solve the anim layer + avatar mask problem that I described above?
No? Nothing? Nobody even has an opinion? Awesome…super helpful community.
No secret sauce, that’s how most people use them. The problem is the Mixamo animations you’re using aren’t setup to blend nicely. The character’s body is facing forward when unarmed but turned sideways when holding a weapon, so when trying to blend the upper body it gets twisted to match the unarmed lower body anims. What I usually do is use something like Animation Designer to combine the top and bottom halfs and make sure its twisted correctly. Otherwise, I use a blendtree of blendtrees for the animations where besides blending on MoveSpeed/Horizontal and Vertical, I additionally blend on a WeaponType which blends the whole body between unarmed and the various weapon types.
Upper Body Override and Locomotion Conflict in Unity
If your character’s upper body still rotates or wobbles while aiming, even with an avatar mask and override layer, here’s why.
The Problem
Even with an avatar mask applied to the upper body, if your base locomotion animations rotate or move the hips/pelvis, that movement carries up the skeleton. Unity’s masking does not block transform inheritance. The upper layer can’t fully override that.
Why This Happens
The spine, shoulders, and arms are children of the hips. If the base layer moves the hips, that motion affects the rest of the body. Unity doesn’t filter this out, even if the bones are masked.
Fixes
Option 1: Fix the Animations
Recreate your locomotion animations so the hips and pelvis are not rotated or moved. Only animate the legs. This prevents spine motion from happening in the first place.
Option 2: Lock Bones in Code
Write a simple script that caches and resets the transform of the pelvis or spine in LateUpdate while aiming. This blocks unwanted movement.
public class UpperBodyLock : MonoBehaviour
{
[Header("Assign the bone you want to lock")]
public Transform boneToLock;
private Quaternion originalRotation;
private Vector3 originalPosition;
void Start()
{
if (boneToLock != null)
{
originalRotation = boneToLock.localRotation;
originalPosition = boneToLock.localPosition;
}
}
void LateUpdate()
{
if (ControllerVariables.isAiming.Equals(1) && boneToLock != null)
{
boneToLock.localRotation = originalRotation; //<-- Locks the bone rotation
// boneToLock.localPosition = originalPosition; //<-- Locks the bone position
}
}
}
Before the script is applied:

After the script is applied :

The script filters out the rotation and transforms data, and it’s up to you to decide if you want both removed or just one of the two.
A list of bones can also be added.. But you do you!
Use Unity’s Animation Rigging package. I had the same problem, I was able to fix this after watching the first half of this video: https://www.youtube.com/watch?v=LEwYmFT3xDk
Instead of ‘HeadAim’, locate the lower spine and use that instead. You should be able to figure out the rest.
I’ll reply with more details if you need.