I am making a 2D game were you can build spaceships with blocks, I have a rigidbody2D as the root node for the spaceship, the best way i could think of is to have all blocks be collision shapes as child of the ship, when placing these blocks they get added to a Dictionary.
my structure looks like this:
Node2D (world)
RigidBody2D
- CollisionShape2D (block: 0,0)
- CollisionShape2D (block: 0,1)
- etc.
when i play the center of mass of the ship is at the origin of the rigid body so (0,0). is there a way to change the center of mass of the ship, or group all the CollisionShapes under a Node2D or something so I can just move the children and the rigid body so that the center of mass matches?
If you have any other ideas on how to handle this situation than thats good as well.