Heyo! I’ve been playing around with the Animation Rigging package for the past couple weeks and had some questions.
I’m an engineer on a small team of lovely folx. We don’t have a dedicated animator on the team, so I’m trying to develop a workflow for authoring 2D paper-doll-style animations that wouldn’t require our designers to learn a bunch of new tools. They’re very familiar with Unity though, so if we can accomplish all of what we need within Unity that’d be great! And Animation Rigging seems like it could make that possible.
So here’s a system I’ve worked out so far:
- We have a prefab for each character.
- Each character has a skeleton that’s just a hierarchy of empty game objects. This is great; authoring, and modifying these skeletons is super intuitive and easy.
- Each character has a bunch of rigs and IK constraints that act on its skeleton. This is also wonderful; animating an arm with 2D limb IK is way better than rotating the bones manually. And we have the technical know-how on our team to create our own constraints too, so that gives us a ton of power and flexibility in the future.
- Animations are authored entirely within Unity by recording changes to the IK constraints. So we don’t touch the bones themselves, we just record the effectors changing. Super easy! No extra tools needed!
So far all of this has looked super promising! But I’ve been stumped in figuring out how to properly implement two things: animation masking and root motion.
Unity provides Avatar Masks for animation masking. An Avatar Mask is generated from an Avatar, an Avatar is generated from a FBX model, and sadly since we’re not using models (again, our “models” are just hierarchies of empty game objects) it seemed like Avatar Masks wouldn’t be a feasible solution for us. But I was actually able to get around this with Unity’s FBX Exporter tool; now we can export our skeletons as FBX files, use those to generate Avatars, use those to generate Avatar Masks, and voila! (This is a shame from a workflow perspective, but if we have to do it, so be it.)
But this doesn’t actually work for us. From my testing, applying an Avatar Mask will cause the animation to ignore all of its IKs. Animations on the bones themselves work fine, but the Avatar Mask prevents the IKs from having any effect. And since our animations are authored entirely using IK changes, this means our animations are wiped out. This happens even if the constraints are children of the FBX, since the Avatar Mask still doesn’t know about the IKs even in that case. (I might be able to bake the IKs into the FBX… but that seems like it’d have a bunch of other downsides.)
I can imagine getting something like Animation Masking by having layers of rigs that overwrite one another, but then it seems like we would need to author our animations bearing in mind whether they’d be used for blending or not. Blending a run forward animation with a sword slash animation wouldn’t work if they both touched the same rig/effectors. So we’d instead need to blend a run forward animation (that animated one set of effectors) with a sword-slash-override animation (that animated another set of effectors set up to override the first set of effectors). Seems clunky.
Root motion has also eluded me. Suppose I animate moving my character forward using IKs such that they end the animation in a new spot. With Unity’s root motion, what I would do is animate moving the root object to the end position as well, and how this is supposed to work (by my understanding and testing) is this shouldn’t affect the animation at all, but when the animation ends that delta will be applied to the game object’s position. But I’m see it double count this movement: it does update the game object’s position, but it also moves the model forward by the same amount. So if I animate a character rolling 10ft forward and I animate the root object to move 10ft forward as well, then my character will appear to roll/slide 20ft forward and snap back 10ft afterwards. So not exactly usable.
So I guess my questions are:
- If I author animations with Animation Rigging IK, how do I mask/blend them?
- Is Animation Rigging intended to play well with Avatars + Avatar Masks?
- How do I accomplish root motion when authoring animations with Animation Rigging IK?
Thanks! Happy to set up a minimal repro repo if it’d help.