I need help detaching the disconnected blocks from the main structure

I made a basic Space-Engineers/Empyrion type dynamic building system by attaching all the blocks to one root actor that has physics enabled, then setting simulate physics to false on all the attached blocks.
This way I can keep track of all the attached blocks in a structure and have the information about it’s total/center of mass.

But the problem is that if some blocks get destroyed, there is a chance one or more blocks will look like they no longer have connection with the root structure but will retain connection and stay attached to the root resulting in unexpected behaviour.
I want the disconnected blocks to form a different root than the previous one so they will have physics after they detach from the previous root.

Now with this info, my question is:
How can I know if a block gets disconneced from the main structure in order to detach it from the root block?
I have a few ideas about this but they’re unlikely to work so I decided to get some help from this forum.

I appreciate anyone who tries to help.

I still need help with that, post is still active.