thes script is used for makeing a spherical planet with perlin noise but when i use it the terrain is blocky is there a way i can finx this? this is the script
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("✅ Noisy sphere terrain generation complete!")
end)