I'm currently messing around with different Terrain methods.
However,when I try this script (taken from the wiki), I get an error saying 'Region cannot be empty' :
region=Region3.new(game.Workspace.A.Position,game.Workspace.B.Position)
region = region:ExpandToGrid(4)
local material, occupancy = game.Workspace.Terrain:ReadVoxels(region, 4)
local size = material.Size
for x = 1, size.X do
for y = 1, size.Y do
for z = 1, size.Z do
print("Material at (", x, y, z, "): ", material[x][y][z])
print("Occupancy at (", x, y, z, "): ", occupancy[x][y][z])
end
end
end
I have two parts in the workspace : "A" and "B" ; Both are at opposite corners of my terrain chunk.
yes,I have swapped the Vector3s when defining 'region', yet it still says "Region cannot be empty".
Any way to fix this?
