There are various issues with your question, as we have no point of reference about your issue.
BUT I was a beta tester of US2 and have pretty extensive knowledge about the workings of the game, so I can help you a bit with the gist of how they did it.
They use Newton’s Law of Universal Gravitation to simulate gravity. They calculate the radius of objects based on the mass and density following the object’s composition. Eg if an object is 100kg (mass), and is made out of pure iron (density of 7.874 g/cm³) then following a spherical volume equation the radius would be calculated as such:
If the magnitude between the two sphere’s center points (c0 and c1) is less than the sum of both radii (r0 and r1) then the spheres have intersected.
local function AreSpheresColliding(sphere0, sphere1)
local magnitude = (sphere0.Position - sphere1.Position).Magnitude
If magnitude <= (sphere0.Size.X/2) + (sphere1.Size.X/2) then
return true
else
return false
end
end