- Home /
Adjust/Change AvatarMask at runtime?
Hello!
I have a ragdoll which is being driven by an Animator component at the root of the character. If I disable the Animator, the entire thing ragdolls, as intended. Similarly, if I add an AvatarMask which disables the animator on part of the character, it will just ragdoll the limbs that are no longer being animated.
My goal is to disable the animator just on limbs that take too much damage, ragdolling them. I can already achieve this effect on limbs that I give the proper AvatarMask to in the editor, but I can't accomplish the same thing ingame.
I have an AnimationLayer just above the base layer that handles movement and my idle animations. Ideally, I want to adjust the AvatarMask for this layer at runtime, adding and removing limbs from it as needed. Alternatively, I could create multiple AvatarMasks for every situation, and swap the layer's AvatarMask out as needed.
However, I can't seem to find a way to change the AvatarMask on a layer at runtime. Is there a way to change it, or should I look for another approach?
Thanks!
Your answer
Follow this Question
Related Questions
Mechainm Animation to Ragdoll 1 Answer
Get weird issue when change from Mechanim -> Ragdoll 0 Answers
I can preview the animation but in scene it doesn't work 0 Answers
Using twist links on a biped with Unity 6 Answers
Mechanim Issue 0 Answers