How to fix blocky terrain and smoothing it out

my script is used to make a spherical planet with perlin noise for ome reason it its blocky and i want to smoothen it outh can anyone help me? video : Watch Screen Recording 2025-10-17 063958 | Streamable

script `–// Services
local RunService = game:GetService(“RunService”)
local CollectionService = game:GetService(“CollectionService”)

–// Settings
local diameter = 5000
local radius = diameter * 0.5
local centerHeight = 0
local blockSize = Vector3.new(5, 5, 2.5)
local material = Enum.Material.Ground
local blocksPerBatch = 10000

–// Noise settings
local noiseScale = 1.0
local noiseAmplitude = 200
local octaves = 6
local persistence = 0.5
local lacunarity = 2.0
local seedOffset = math.random()

–// Angular step helper
local function getAngularStep(blockLength, radius)
return math.deg(blockLength / radius)
end

local layerStep = getAngularStep(blockSize.Y, radius)
local stepStep = getAngularStep(blockSize.X, radius)

–// Fractal Brownian Motion noise
local function fbm(x, y, z, seed)
local value, amp, freq, maxAmp = 0, 1, 1, 0
for i = 1, octaves do
value += amp * math.noise(x * freq, y * freq, seed + i * 10)
maxAmp += amp
amp *= persistence
freq *= lacunarity
end
return value / maxAmp
end

–// Core planet part (for gravity reference)
local planetBall = Instance.new(“Part”)
planetBall.Size = Vector3.new(2000, 2000, 2000)
planetBall.Position = Vector3.new(0, centerHeight, 0)
planetBall.Anchored = true
planetBall.Material = Enum.Material.SmoothPlastic
planetBall.Shape = Enum.PartType.Ball
planetBall.Name = “PlanetBall”
planetBall.Parent = workspace
planetBall:SetAttribute(“Diameter”, diameter)
CollectionService:AddTag(planetBall, “Planet”)

–// Simple spawn point
local spawnLocation = Instance.new(“SpawnLocation”)
spawnLocation.Size = Vector3.new(20, 1, 20)
spawnLocation.Position = Vector3.new(0, centerHeight + radius + 10, 0)
spawnLocation.Anchored = true
spawnLocation.CanCollide = true
spawnLocation.Transparency = 0.5
spawnLocation.BrickColor = BrickColor.new(“Bright green”)
spawnLocation.Name = “PlanetSpawn”
spawnLocation.Parent = workspace

–// Terrain generation coroutine
task.spawn(function()
local totalCount = 0
for layer = 0, 180, layerStep do
local layerAngle = math.rad(layer - 90)
for step = 0, 360, stepStep do
local stepAngle = math.rad(step)
local rot = CFrame.Angles(layerAngle, stepAngle, 0)
local dir = rot.LookVector
local nx, ny, nz = dir.X * noiseScale, dir.Y * noiseScale, dir.Z * noiseScale
local n = fbm(nx, ny, nz, seedOffset)
local displacedRadius = radius + n * noiseAmplitude
local position = CFrame.new(0, centerHeight, 0) * rot * CFrame.new(0, 0, displacedRadius)
workspace.Terrain:FillBlock(position, blockSize, material)
totalCount += 1
if totalCount % blocksPerBatch == 0 then
RunService.Heartbeat:Wait()
end
end
end
print(“:white_check_mark: Noisy sphere terrain generation complete!”)
end)

why not use fillball ?

at this point you have use advanced features of terrain

Use code blocks t
as its easier to read

like this

code here

the lua isn’t needed but do 3 `

actually i just tried fill ball with some overapping logic thanks man.