Can dynamic components be connected, simulating a hinge?

The components are four doors, 1+1 and 1+1, that meet in the middle. It makes sort of a door wall that opens in stages with the inner ones hinged to the outer ones and the outer ones hinged to the wall. The inner ones hinge 180 degrees to lay flat against the outer ones. Then the outer ones hinge 180 degrees to lay flat against the wall.

Is there a way to “connect” these inner ones to the outer ones, so that their coordinates are always relative to the coordinates of the outer door? I’m trying to simplify my dynamic component script so that “onClick” makes the inner doors just rotate around their Z axes, and the “onClick” again makes the outer doors rotate around their Z axes and taking the inner doors with them. Currently I am doing this by defining a bunch of Y and X movements so the inner doors at least end up where they’re supposed to be.

place the door within other and alternate the rotation

of course uploading the file would help you specifically