Animation rig with non-root animator

My character controller is set up such that the animator is a child of the root object. Trying to set up the rig builder on the child, throws an error that prompts me to put the rig builder component on the root GO. By default, it requires the animator to be present there also, but overriding this and manually referencing the (child) Animator component, throws a number of “PropertyStreamHandle cannot be resolved” errors.

Is it currently possible to use animation rigging with such a setup? If so, how do I set this up?

Thanks,

  • K

The RigBuilder is only meant to work when it is on the same GameObject as the Animator. This should be enforced by the [RequireComponentTypeof()] attribute at the top of the RigBuilder component. Things will break when you are overriding the reference. However, it should be possible to set up a RigBuilder + Animator any where in the hierarchy.

You can verify this by grabbing the Animation Rigging samples from the package manager. For any of the sample scenes you should be able to create an empty gameobject and child the root gameobject to it. The sample should still work the same after this.

To help you better it would be great to have some more information. Could you specify what the error is you are getting when you have a setup with the rigbuilder on the child? We have had a bug with this in the past but it should be fixed in recent versions. Could you also provide us with the Unity version and Animation Rigging version (which can be found in the package manager) you are using?

I find it happens specifically when using animators using an avatar setup. If I initialize the rig on the root, and then reparent it to a different root transform, the problem doesn’t occur. I suspect the error has something to do with the avatar rebuilding process, which expects the animator to be in the root.

Unity version 2019.b7
Animation rigging 2.0.3

Hi Ragoo,

This is a bug and is already tracked in our bug database.

Here is the issue tracker link if you want to follow up on progress: https://issuetracker.unity3d.com/issues/animation-stream-binding-animationstream-handles-on-a-nested-animator-hierarchy-triggers-an-exception

This is triggered because animation job handles in animation rigging are adding additional Transforms to the stream which were not in the original avatar. To work around this for now, you can try regenerating a generic avatar (that is considering you have a generic rig) like so:

5109929--504284--Screen Shot 2019-09-30 at 11.29.18 AM.png

1 Like

Thanks! For now, I’ve found a temporary workaround:

  • Ensure the RigBuilder component is disabled before entering play mode
  • Unparent the Rigbuilder/Animator transform
  • Enable the RigBuilder component (so that it initializes/rebuilds)
  • Wait one frame for the building to process (e.g. in a Coroutine)
  • Reparent

This also works if you want to edit the avatar in runtime (e.g. when you’re programatically editing poses/proportions for character customization).

1 Like

For me that works only if i enter play mode before step 2.
So its just a workaround for a single playmode run or did i miss something?

This stops me in my tracks. Using humanoid rig with retargeted anim, back to default ik.

A fix for https://issuetracker.unity3d.com/is…sted-animator-hierarchy-triggers-an-exception has been released for current beta versions of Unity 2019.3 and 2020.1.

Next release of Unity 2019.2 (2019.2.15f1) should have the fix as well.

2019.3.0f1 :frowning:

1 Like

Hi,

We reproduced the same issue with humanoid characters when retesting. This is very unfortunate. While the initial fix did solve the issue for generic characters, it overlooked humanoid characters. We have opened a bug for the new issue: https://issuetracker.unity3d.com/issues/animation-stream-binding-animationstream-handles-on-a-nested-humanoid-animator-hierarchy-does-not-work

I have written a fix for this and it should hopefully be available in previous Unity versions soon enough.

Sorry about that!

3 Likes