- Home /
Parent and rotation constraints are influenced by sources whose weights are set to zero
When I create a parent or rotation constraint with multiple sources, and animate the weight of those sources; the constrained object's rotation continues to be influenced by sources whose weight is set to zero.
This happens only when multiple sources are active. For instance, if the weights of Source2 and Source3 are set to 1, and the weight of Source1 is set to zero; rotating Source1 will influence the object anyway.
By contrast, if Source2 and Source3 are set to 1, and Source4 is set to zero, rotating Source4 does not appear to influence the constrained object; so this bug appears to have something to do with the order in which the sources are applied.
To illustrate this another way:
Case 1:
Source1: weight = 0
Source2: weight = 1
Source3: weight = 1
Source4: weight = 0
Source1 affects the object's rotation, regardless of its weight.
Source4 does not affect the object, as normal.
Case 2:
Source1: weight = 0
Source2: weight = 1
Source3: weight = 0
Source4: weight = 0
Only Source2 affects the object, as normal.
I have been very impressed by both these new constraints and their cooperation with Maya and timeline; but this makes interpolating between three or more sources impossible without compromising animation quality, drastically reducing their usefulness.
Answer by silverbackAlex · Jun 05, 2018 at 09:15 PM
I ended up working around this by setting the entire list of constraint sources in code, rather than trying to animate the weights themselves.
My solution involved storing all of my sources in a list, interpolating their weights how I wanted them, and some logic that created a smaller list containing only those sources whose weights are above zero. Then I applied those sources to the constraint.
This is probably not as performant as setting weights, but it effectively prunes all of the unused sources and resolves the issue. For my purposes, performance is something of a moot point because otherwise - to call a spade a spade - this bug means that Unity's new constraints really support only two sources.
Answer by bogdancoder · Jun 20, 2018 at 03:52 PM
Hi,
Thank you for reporting this issue.
I have been able to reproduce the problem. I will provide a fix as soon as possible.
Thanks!
I'm still seeing this issue in 2019.2.15f1. Any update on a fix?
EDIT: Never $$anonymous$$d, seems to be another issue. It's wrong even with a single source. Appears to be an issue with the 2D animation package. EDIT 2: Turns our if you are using the 2D I$$anonymous$$ package you should use your I$$anonymous$$ Handle as your source rather than the bones it's driving.
Your answer
Follow this Question
Related Questions
How to move hips in Unity Animation Rigging IK 0 Answers
Is it posible to adjust an animated bones POSITION at runtime. Not the rotation. 1 Answer
Animation Rigging: Constraining handheld objects 0 Answers
How to force the editor to evaluate constraints? 0 Answers
blender to unity animations 1 Answer