Weird Collision Box on Union

I used SubtractAsync to cut a rectangular hole in a baseplate and put a part below the hole like this:
image

And the collision shape is like this for some reason

Here is the script:

math.randomseed(1800)

for i=0, math.random(4, 7) do
	local holePart = Instance.new("Part")
	holePart.Position = Vector3.new(math.random(-888, 888), -4.777, math.random(-888, 888))
	holePart.Parent = workspace
	holePart.Size = Vector3.new(math.random(128, 512), 8, math.random(128, 512))
	holePart.Name = 'HoleQ'
	
	for i, part in workspace:GetPartBoundsInBox(holePart.CFrame, holePart.Size) do
		if part.Name == 'TreeHitbox' then
			part.Parent:Destroy()
		end
	end
	
	--workspace.Terrain:FillBlock(holePart.CFrame, holePart.Size, Enum.Material.Water)
	
	local hole_fill = holePart:Clone()
	hole_fill.Position = Vector3.new(hole_fill.Position.X, hole_fill.Position.Y - (hole_fill.Size.Y * 1.7), hole_fill.Position.Z)
	hole_fill.Anchored = true
	hole_fill.Parent = workspace
	hole_fill.Name = 'WaterBedrock'
	hole_fill.Material = Enum.Material.Sand
	hole_fill.BrickColor = BrickColor.new("Sand yellow")
	
	local new_base = workspace.WorldBase:SubtractAsync({holePart}, Enum.CollisionFidelity.PreciseConvexDecomposition)
	holePart:Destroy()
	workspace.WorldBase:Destroy()
	new_base.Parent = workspace
	new_base.Name = 'WorldBase'
end

If anyone knows the cause/solution to this problem, please let me know! :slightly_smiling_face:

Hello, @Omnomc. I see you are having trouble with collisions on your union. I have recently created a building plugin that uses unions to create openings for doors and I have found a solution to the issue you are facing.

Roblox, by default, automatically generates poor collisions for unions to save on preformance. However, in many cases this functionality is not desirable. You can change the properties of the union to enable more accurate collisions in your unions.

Change:

  1. RenderFidelity to Precise
  2. CollisionFidelity to PreciseConvexDecomposition

These changes will remove issues with collision boxes since roblox will compute the collision boxes with more detail.