Trying to make voxel destruction

Ok so I’ve been trying to make a voxel destruction system for my game, I got most of it down but now I have to solve one thing:

How could I make the part’s size 1x1x1?
Most of these scripts I got from other forums and modified.


	function module:divide(part:BasePart)
		local halfX = part.Size.X / 2
		local halfY = part.Size.Y / 2
		local halfZ = part.Size.Z / 2
		local smallSize = Vector3.new(halfX, halfY, halfZ)

		local offsets = {
			Vector3.new(-0.5, -0.5, -0.5),
			Vector3.new(-0.5, -0.5,  0.5),
			Vector3.new(-0.5,  0.5, -0.5),
			Vector3.new(-0.5,  0.5,  0.5),
			Vector3.new( 0.5, -0.5, -0.5),
			Vector3.new( 0.5, -0.5,  0.5),
			Vector3.new( 0.5,  0.5, -0.5),
			Vector3.new( 0.5,  0.5,  0.5),
		}

		for _, offset in ipairs(offsets) do
			local smallPart = part:Clone()
			smallPart.Size = smallSize
			smallPart.CFrame = part.CFrame * CFrame.new(offset * smallSize)
			smallPart.Parent = part.Parent
		end

		part:Destroy()
	end
	
return module

local function hitbox(size: number, part: BasePart)
	local hb = Instance.new("Part")
	hb.Size = Vector3.new(size, size, size)
	hb.CFrame = part.CFrame
	hb.Anchored = true
	hb.CanCollide = false
	hb.BrickColor = BrickColor.new("Bright red")
	hb.Transparency = 0.5
	hb.Shape = Enum.PartType.Ball
	hb.Parent = workspace
	game.Debris:AddItem(hb, .1)


	for i = 1, 6 do
		local hitparts = workspace:GetPartsInPart(hb)
		local divided = false

		for _, v in ipairs(hitparts) do
			if i == 6 and v:HasTag("map_piece") then
				v:Destroy()
			elseif v:HasTag("map_piece") then
				mod:divide(v)
			end
			

		end

	end
end


hitbox(10, workspace.Part)
--part is the ball in the picture

What I got:

What I’m trying to achieve:

Hey there! Why don’t you just use a pre-existing module such as VoxBreaker, VoxelPhysics, or VoxelDestruct? If you really want to make your own, perhaps check out this youtube tutorial.

You should use premade resources for something complex like that, thats what resource devs such as myself would want. Go ahead and give my VoxelDestruct a try, you can easily set a part, meshpart, or model to destroy things.

You can optionally offload it to the client for better performance, there’s settings to make it load to clients when they join. If you have any questions about it let me know, thanks!