Unity's inbuilt AvatarMask
system allows you to control which bones each layer affects as demonstrated in the Layers samples, however it's limited to entirely enabling or disabling bones. Animancer's WeightedMaskLayers
component instead allows you to control the Weight
of each individual bone, including fading them over time.
How to Use
- Add a
WeightedMaskLayers
Component:
- Click its
Edit
button in the Inspector to open a window where you can configure it.
- Use the
?
column to enable the bones you want to include in the mask. - Use the
Add Group
button down the bottom to add as many groups as you want. - For each bone and group, enter the
Weight
you want the bone to have when that group is active.
- 1 is the same as including that bone in an
AvatarMask
, i.e. Layer 1 will fully control the bone. - 0 is the same as excluding that bone from an
AvatarMask
, i.e. Layer 0 will fully control the bone. - Values in between will interpolate between both layers.
- In code if you want to change the current
Weight
group you can get a reference to theWeightedMaskLayers
component and callSetWeights(groupIndex)
orFadeWeights(groupIndex, fadeDuration)
.
Known Limitations
- It only supports 2 layers (Base + 1).
- It only supports override blending (not additive).
- These limitations could be removed with further development if enough users request it.