Constraint weight reset after changing playable graph

Hello,

I’m facing an issue where the weight of my constraints is reset every time the playable graph changes in my project.

I need a way to override my multi-parent constraint behaviour to prevent the weight from changing when the playable graph is modified.

I’ve tried a few solutions to fix this issue, but none have worked as intended so far.
I considered using Playable.KeepChildrenConnected = true to prevent the disconnection and reconnection of playables from affecting the weight, but I decided against it due to performance concerns.
I also tried rebinding and setting the weight after, but it didn’t solve the problem.

I’m seeking advice or suggestions on tackling this problem without compromising performance. I’m open to any ideas or suggestions the community might have.

Attached are the two scripts I’ve created to override the constraint.

Thank you in advance!

9652361–1373375–MultiParentConstraintOverride.cs (3.48 KB)
9652361–1373378–MultiParentConstraintOverrideJob.cs (10.2 KB)

The performance might not be as bad as you think. When I did mine, the difference in frame rate was under 10% with animations being the only thing happening so in a real game with other stuff going on the overall difference would be even smaller. The numbers may vary with a different model and different number of animations so I’d recommend comparing it yourself. The reason I don’t like that approach is mainly just that it’s inconvenient to need to initialise everything upfront when that isn’t otherwise necessary.

If you do manage to come up with another solution though, I’d love to hear it because this seems like a really stupid limitation for the system to have.

1 Like

Sure thing.
I’m stubborn, I’ll figure out something sooner or later.