So, basically I'm trying to do a "Custom Terrain" with math.noise.
The next script generates a new series of parts, which uses math.noise to set the part's Y position, but for some reason every part has roughly the same Y position..?
There's no parts nor models inside Workspace.
Server Script located in Workspace:
local function NewCells()
for line = -X, X, 1 do
for collumn = -Z, Z, 1 do
local Cell = Instance.new("Part", workspace.Cells)
Cell.Anchored = true
Cell.Size = Vector3.new(Size, Size, Size)
local Y = MinY + (MaxY - MinY) * (1 + math.noise(MinY / Size, MaxY / Size, Seed) / 2)
Cell.Position = Vector3.new(line, Y, collumn)
end
end
Seed = math.random(0, 1000)
end
while true do
if #workspace.Cells:GetChildren() <= 0 then
NewCells()
else
workspace.Cells:ClearAllChildren()
NewCells()
end
wait(5)
end
Hope someone helps me figure this out. Thanks.
