Reposition objects during character customization

So I have a robot that can be customized.

Each part of the robot (Head, Torso, Arms, Legs) can be changed with different shapes and forms.

The robot looks like this (I’m using Unity objects for now) :

85805-1.png

Let’s say the user changes the Torso and decides to put a cube torso instead of the rectangular one, then it would look something like this :

85806-2.png

Now in both cases, the parts aren’t really joined together, you can clearly see space between the head and the torso, the arms and torso, the legs and torso.

Regardless of the shape and form the user chooses, the end result should look like this img link without any spaces.

Each part has its own collider (Box/Sphere/Cylinder), so I was thinking of moving a part (ie: Head) downwards until it collides with the Torso so that it sits on top of the torso removing unwanted space.

What do you think of this approach? Is there anything simpler?

Using physics may not be a good idea for this purpose I guess.

What I advise you :

  1. Each part of your robot must provide empty gameObjects called “AttachPoints”

    • Each head must have its attach point at the bottom, the torso must have 5 attach points, …
  2. Each part of your robot must have a script referencing their attach points

  3. When changing part of the robot (except torso), move the part so that its attach point is attached to the attach point of the torso

    • For the head, you may have : this.transform.position = torso.headAttachPoint.position + ( this.transform.position - this.torsoAttachPoint.position ) ;
  4. When changing the torso, move all the parts of the body so their attach points are attached to the attach point of the torso