How could I make it so that two objects snap to eachother?

I’m planning on making two snap points snap together by using raycast to get their tags and an if statement to tell which one I’m holding. The problem is that the snap points are parented to the object that should move with them ,but if I only snap the children to the other snap points transform will the parent object follow? If not how could I do this?

This question has come up a couple of times in the past year in relation to jig-saw puzzles, where the the developer wanted to allow the user to put a couple of pieces together, and the drag those pieces by clicking on either of the two pieces. My suggestion to one of those questions was to establish a parent of any pieces that are snapped together. So if you snapped two pieces together, you would have an empty game object as a parent, two pieces as children, and each of those pieces would have (in your case) six snap points. If more individual pieces are snapped into the first two, they get the same parent. If the user drags any piece, then the parent is moved and all the children follow. If two multi-piece sections are clicked together, one parent is abandoned, and all the resulting pieces are given same parent.