# How to generate a Sphere out of Blocks (1,1,1)

Hey there,

I’m trying to figure out how to generate a sphere out of single Block parts. The size is e.g. 1,1,1.

I found this post and modified it to summon block parts but it is not exactly what I’m trying to achive.

I need a script which generates a spheric like planet out of blocks but it also needs to be filled with them. I tried to find posts or tutorials but never found one.
Can someone may help?

Thank you

1 Like

Have you seen this post?

1 Like

thank you so much never saw it !

Here is a function to do this for you it’s probably lighter than a module anyway.

``````function sphereFromPart(centerPos,radius,parent)
local basePart = Instance.new("Part")
basePart.Size = Vector3.new(1,1,1)
basePart.Anchored = true
basePart.Parent = parent
for x = 1, radius*2 do
for y = 1, radius*2 do
for z = 1, radius*2 do
local worldSpace = Vector3.new(-x+centerPos.X,-y+centerPos.Y,-z+centerPos.Z)
local new = basePart:Clone()
new.Parent = parent
new.Position = worldSpace
end
end
end
end
end

--example
sphereFromPart(Vector3.new(0,100,0),20,game.workspace)
``````

This will be a solid sphere.

3 Likes

Thank you this looks nice!!!

Thanks I actually updated it so that the position you supply would be the actual center of the sphere and you get a folder that contains all the parts so you don’t get flooded!

``````
local sphereFolder = Instance.new("Folder")
sphereFolder.Name = "Sphere"
sphereFolder.Parent = parent
local basePart = Instance.new("Part")
basePart.Size = Vector3.new(1,1,1)
basePart.Anchored = true
for x = 1, radius*2 do
for y = 1, radius*2 do
for z = 1, radius*2 do