Generation Problem Need Help

How would i make it so the next cube isnt in the same pos and the other one?

local Y = 2
local X = 2
local Z = 10

while true do
local Offset = 2
for i = X+Offset,0,-1 do
for s = Y+Offset,0,-1 do
for d = Z+Offset,0,-1 do
local part“Part”)
part.Parent = workspace
part.Size =,1,1)
part.Anchored = true
part.Position =,Y+Offset,Z+Offset),s+Offset,d+Offset)
Offset = Offset+2
if u have any suggestions please tell

local offset =, 0, prevCube.Size.Z/2) nextCube:PivotTo(prevCube:GetPivot() * offset)

Something like that I think. You can make the x,z positive or negative to choose which direction relative the previous cube. Negative X would be forward. In the example, I moved it both on the x and z axis so that would move it diagonally. The cube size used is cut in half because we are moving based on the center position. If you use full size it will have space between them equal to half the size.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.