2D physics on game object made up of components

Say you want to let your users create a 2D airship (side view) made up of components. One component could be a floating balloon, another could be a storage room, etc.

And say you want this airship to have physics applied to it as a whole, with each component playing a part in this. For example, balloons would take away from its down force and other compartments would apply down force to it.

At the same time, the whole airship works as a whole (or at least the only physical separation would be between floater components and the others, which apply weight), so physics are applied to it as if it was one body.

Now, how can this be managed? How can I customize a game object via a script, giving it different components with different weights, and have it behave like it was a single premade object?

I’m sorry if the question is simple, but I’m only getting started with unity. Thank you very much!

TL;DR: Customizable airship gameobject with different components that have different weights. How to make it behave as a single physics entity?

You would need to create a script that has different room settings for each ship component. This “room” script would dictate how much mass, or drag (for example) the ship component adds to the rigidbody of the entire ship. You could also have a method that adds down force or lift force based on the ship component you are working with.

Each room would not have a rigidbody on it, instead the entire ship would have the rigidbody that is being manipulated by each room via a script.