Basically, I have a grid of many 15x15 Parts. I use code to edit these Parts' color and Y size, somewhat randomly. I then use the color and size of the Parts to generate Smooth Terrain with the correct size and material.
The regular Parts are changing color and size just fine. However, when I go to generate the Smooth Terrain, for some reason the map is full of holes. It's doesn't make a lot of sense.
This is my grid of regular Parts.
This is what happens when I edit their size and color, prepping for the terrain generation.
This is what happens when I generate the terrain. See the holes? Currently I just manually made the Parts invisible so you can see the terrain clearly, although they will eventually be getting deleted after the terrain is formed.
This is the function I use for generating terrain based on the properties of the Parts:
function smoothTerrain()
--'loaded' is just a Model filled with all the correctly colored and sized Parts.
for i, part in ipairs(loaded:GetChildren()) do
if part.BrickColor == BrickColor.Blue() then
workspace.Terrain:FillBlock(part.CFrame, part.Size, "Water")
elseif part.BrickColor == BrickColor.Green() then
local shape = math.random(1, 2)
if shape == 1 then
workspace.Terrain:FillBlock(part.CFrame, part.Size, "Grass")
else
workspace.Terrain:FillBall(part.Position, part.Size.Y/2, "Grass")
end
else
workspace.Terrain:FillBlock(part.CFrame, part.Size, "Sand")
end
end
end
How can I fix this holey map?

6 comments
It may be an bug on ROBLOX's side.
Hope not.
That seems quite odd. Try changing ipairs to pairs or changing line 11 to use the X or Z position, maybe? Not too sure.
That actually helps, not using the Y, since the height will never be larger than the width. Still having some issues, but thanks.
I would use RbxUtitily for that, because really workspace.Terrian does have a bug and ROBLOX just never fixed it yet. :/
RbxUtitily? explain please?