My game is designed to blow stuff up, that being said; I've made a big house and the walls in it are solid and close to impossible to knock down with explosives. I cannot seem to find the right math to make an 8x8 block into multiple 2x2 blocks in the same position/color/property.
✓ ANSWER ACCEPTED
Best way to fragment a part/model into multiple parts?
1 answer
✓ Accepted answer
If you're trying to split up a cube, then the following should work.
function splitCube(block, divisions)
for x = (-divisions/2+0.5), (divisions/2) do
for y = (-divisions/2+0.5), (divisions/2) do
for z = (-divisions/2+0.5), (divisions/2) do
local p = block:Clone()
p.Parent = block.Parent
p.Size = block.Size / divisions
p.CFrame = block.CFrame + (Vector3.new(x, y, z) * (p.Size.x))
end
end
end
block:Destroy()
end
The +0.5 is down to the way position is in the centre of a part, not the edge.
Alternatively, you could increase the BlastPressure of whatever explosions you're using.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Works perfectly, you're a godsend. I won't forget this, thank you.