You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Smooth terrain by filling in perlin noise generated parts. -
What is the issue? Include screenshots / videos if possible!
Weird drops are appearing making it look like a staircase.
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried making the parts bigger but that didn’t help. I heard I can use WriteVoxels but I don’t know how to use it and I’m not sure how to calculate what occupancy to set the terrain to. If this is the solution, how would I use it to fix my problem?
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Here’s my code:
local amplitude = 100 -- extent of peaks and troughs
local frequency = 10 -- how often peaks and troughs appear
local fogmapsize = 500 -- length and width of map
local resolution = 4000 -- how detailed map is (scale with amplitude)
local Terrain = workspace.Terrain
local seed = math.random(0, 100000)
function genHeight(x, z)
local noiseheight = math.noise(x/resolution * frequency, z/resolution * frequency, seed) -- generates height
noiseheight = math.clamp(noiseheight, -0.5, 0.5) + 0.5 -- keeps noise value within the bounds it's made for and brings it above ground
return noiseheight
end
for x = 1 , fogmapsize do
for z = 1, fogmapsize do
local part = Instance.new("Part")
local h = genHeight(x, z)
part.Anchored = true
part.Parent = workspace.MapParts
part.Size = Vector3.new(6, 1, 6)
part.Position = Vector3.new(x, h*amplitude, z)
Terrain:FillBlock(part.CFrame, part.Size, Enum.Material.Grass)
part:Destroy()
end
game:GetService("RunService").Heartbeat:Wait()
end