Possible bug with humanoid rig and multi-parent constraint?

I’m on 2019.3.6 with the latest version of the Animation Rigging package (0.2.6).

Whenever I try to use a multi-parent constraint or multi-position constraint with a child of the animator root as the constrained object and a skeleton bone as the source object, the root just starts travelling infinitely in one direction.

I’m pretty sure this has something to do with the humanoid type rig on my character, because I didn’t get this problem when it was set to generic. Am I doing something wrong or is this genuinely a bug?

1 Like

Update: Further testing has revealed that the problem only occurs when trying to constrain direct children of the animator. Grandchildren can be constrained with expected behaviour. Also, the sourceobject does not have to be set to a skeleton bone directly, objects constrained to a skeleton bone can also invoke the problem.

Hi, this indeed looks strange.
Did you confirm that you can only get that issue with humanoid character setups?

We did reproduce issues with humanoid hierarchies that could explain your problem:

Can you log a bug with a quick repro project through the Unity bug reporter? We will have a look :slight_smile:

Sent! I figured out that it was a combination of a humanoid rig and a translation on the parent of the animator.

Hello, I probably ran in the same issue, how it resolved? I have multi-position constraint affecting hips on humanoid ch. Flies away even if it’s turned off.

Thank you for any help

An official fix for the bug hasn’t been addressed yet, my bug report went nowhere.

As for how you can work around it, assuming that your hips are a direct child of the animator, I’d suggest putting your hips transform as a child of another transform (maybe call it “skeleton”?), so that you aren’t constraing a direct child of the animator.

For anyone else checking this thread in the future, just make sure that you aren’t constraining direct children of a gameobject that has an animator on it and you should be good. Put your constrained objects inside of an empty transform or similar so that they are no longer direct children.

3 Likes

Hi, I’m not sure we ever received your bug report actually :frowning:
Do you mind sending a link to the issue tracker, or the case number so I can look it up?

i have an issue, on 2019.4.0f1 LTS with Animation rigging package 0.2.6, that i believe is very similar,
i used the female model on starter kit synty studios and on a custom model and i could reproduce it,
i don’t know how to use the report bug feature so i will do that here.

My issue is that the character was sent forward without any reason when he had constraints like multi aim and multi parent/position (potentially all the other “multi” constraints are affected)
here is the reproduction steps:

  • import a 3D model (i used the “SM_Character_Female_01” from the “starter kit synty studios” ,the first search result on the asset store) on the project.

  • put the model to Humanoid and create the avatar definition

  • create an empty gameobject. let’s call it “heroineParent”.

  • Reset the transform of that “heroineParent” we just created.

  • on the Z axis, put a positive value, this will make the object go in the Z axis

  • put the 3D model you imported earlier into the scene as a child of the “HeroineParent”.

  • create a rig builder on the added model root (it should have the animator component), lets call that gameobject “the heroine” from now on.

  • Uncheck root motion on “the heroine” animator component.

  • create an empty child gameobject of “the heroine” and call it “RigLayer”.

  • add a new rig component to that “RigLayer”.

  • create an empty children to that “RigLayer”

  • on that children add a component “Multi-Aim Constraint”.

  • create an empty children of "the heroine and lets call it “ConstrainedGameobject”

  • back to the gameobject that has our “multi-aim constraint”, drag the “ConstrainedGameobject” on the constrained Object Property

  • now add “the heroine” to the source object (or anything else really).

  • reference the “RigLayer” to “the heroine” RigBuilder in the rig layers property

  • Press play

Thank you for that repro DrBoum.
I found the associated bug you reported in our database and started looking at it.
You can monitor it here: https://issuetracker.unity3d.com/product/unity/issues/guid/1259490/

I have a local fix that solves the issue, but I would like to make sure it holds up. Most issues we find with humanoid characters are in Unity core animation c# jobs, so you can look forward for a fix to this issue in an upcoming Unity release.

1 Like

thank you for your fast answer, for the workaround props to SpicyMayonaise what he said, is avoiding your source gameobject to be a direct child of the Gameobject containing the animator component, worked for me.
i have a side question on the animation rigging constraints. currently we need to specify the source at editor time it is not very practical when you instantiate the gameobjects at runtime. is there any plan to be able to switch sources at runtime?

Hi,

Short answer: no.

Longer answer:
Animation Rigging builds a Playable Graph that is evaluated by the animation system and processes Transforms directly in the animation threads. In order for that to be performant, animation c# jobs bind Transforms in the animation stream and therefore, changing these means you need to recreate the graph.

You have several options in order to do what you want:

You can rebuild the Animation Rigging graph (by calling RigBuilder.Build) with the new parameters which will ensure the PlayableGraph has the newest values. However, I would be cautious in calling that too often, as it can be a costly operation.

Multi constraints have several sources to cover these cases. So, you could create placeholder source game objects to control your multi-aim constraint with and change weights to cycle from one to the other. Of course that means you’d need to also use these placeholder game object as parent to whatever you’d want to instantiate.

Hoping this helps!

The workaround did not work for me and this issue still happening with me event though it says it was fixed

Have the same problem here, and I think it could be the script execution order, I mean that, the ParentConstraint gets the position of the bone before the animator sets it, so the position got is the original position without animation, the problem is we don’t have acces to modify the execution order of these two components

Same, this workaround didn’t work for me.

Multi-Position Constraint does nothing - I have a main camera I want to shift it smoothly around different moving objects in a scene - but no response - moving the weights does nothing - odd?