Good morning, afternoon or evening!
Recently I’ve been rewriting a major system for one of my games, and all of it was working up until it came for terrain generation. It loops through the descendants, but no terrain appears whatsoever. The strange thing is, there are no errors that usually indicate what is wrong, the only errors are because I haven’t added a check to see if the Instance is a Part and not a Value.
mapClone = this.selectedMap:Clone()
mapClone.Parent = game.Workspace
mapClone.Name = "Loaded_Map"
--Do some special trickery to use terrain generation
for _,x in pairs(mapClone:GetDescendants()) do
s,e = pcall(function()
if x.Anchored == true and x.Transparency == 0 and not mapClone.Name == "PaperHouse" then
tr = game.Workspace.Terrain
m = x.Material
if m == Enum.Material.Sand and x.BrickColor == BrickColor.new(18,238,212) then
m = Enum.Material.Water
elseif m == Enum.Material.Glass then
m = Enum.Material.Air
end
tr:FillBlock(x.CFrame,x.Size,m)
x.Transparency = 0
x.CanCollide = false
end
end)
print(s,e)
end
Any help would be greatly appreciated (i’ve checked the wiki, and read through it again and again, and none of my solutions seem to work)