Modular GameObject system

I’m trying to build a game where units can be built dynamically. Let’s say I want to build a tank. I want to be able to select a chassis, hull, turret, engine, cupola, finial, etc.

The hull is connected to the chassis, the turret and engine should be on the hull, the cupola should be on the turret, and the finial on the cupola. Some turrets might have 2 cupolas, some might have none.

The mesh will likely be different from one to another, so mounting points will move around.

The main object (tank in this case) should be able to get a list of gameobjects connected to it.

I have strong programming knowledge, some 3D experience and fairly new in Unity.

I also spent awhile looking online to see if this question (which would seem a common thing) has been answered or implemented in the engine. So far I haven’t found a good example.

Thanks for your help

I would just create a simple custom class for the vehicle hull, and give it variables for attachment points (turret, engine etc) that you can freely assign. Something like this:

public class TankFrame {
     public GameObject frame;
     public GameObject turret;
     public Vector3 turretPos;
     public GameObject engine;
     public Vector3 enginePos;

}