Enable/Disable Articulation Body Hierarchy

For more performance and stability, I want to switch on/off an articulation arm and the configurable joint that link the main rigidbody to the arm itself.

The articulation arm is a chain of ArticulationBody. I try both enable/disable or SetActive(true/false) but both cause very strange behavior: is like the ArticulationBodies reset all the init parameters and the rotation reference is totally wrong.

So when I reactivate it, they try to reach a wrong place.

Is there a safe way to disable it?

You can save the jointPosition and jointVelocity of each child just before you disable it and restore those values after you reenable the ArticulationBody component.
I assume upon changing the active state of one child causes the whole Articulation hierarchy to rebuild

Unlikely I notice that also all Joint parameters are reset. So if I set a limit in terms of angle degree, the center point is set to the new start position, so if I set a new target Joint position the arm move to another position (outer of the original limit). :frowning:

I probably need to save ALL Joint and ArticulationBody but this is very annoying.

Did Anyone find some trick? What I need is just a flag the avoid re-initialization after the wake-up.

Thanks.

Was hoping for some sort of IsKinematic functionality for Articulation Bodies, I’m running into this issue myself at the moment as they’re pretty good for making stable ragdolls but kind of redundant at the same time if you can’t toggle the ragdoll state and instead need an entirely standalone ragdoll.

Also running into this issue and would like to avoid reinitialisation. Our gameplay involves situations where articulation hierarchies are ‘broken’, ie. certain joints are removed from the chain. This also causes the whole hierarchy to be retinitialised as Klamore74 has noted. Very frustrating!

Some info & code here about preserving the body state when you Enable/Disable Articulation Body Hierarchy.
If Anja Haumann’s code still works (I’ve given up on this and cheat now:) I think it’s pretty neat:)

1 Like