Every time I add a new articulation body dynamically as a child to an existing articulation body hierarchy, all bodies in the hierarchy get reset to their initial orientation. E.g. if a closed door is opened during gameplay then I add a new articulation body child to that door during runtime, the door will suddenly close as well as any other body in the hierarchy, they all reset to their initial orientations.
Is this an expected behavior? and is there any workaround?
You can save the state of the whole tree by traversing all ArticulationBodies and storing jointPositions and jointVelocities. You can write them back after you added the child.