For loop doesn't place parts with different positions

Hello. I tried writing a code that would iterate 18 times to create a quarter circle with equal spaces between blocks, in this case 13 studs. i tried to clone a model called “sidelane” which has only 1 part inside it. there would be an orientation gap of 5 degrees between each part and each of them would go forward every iteration, but it just gets the sidelane’s position and orientation and it clones the model 18 times at the same position, 13 studs forward of the original sidelane model.

this is the code:

for i = 1,18 do
	local s = workspace.sidelane 
	local sc = s:Clone() 
	sc.Parent = workspace
	sc.Node.CFrame *= CFrame.new(0,0,-13) 
	sc.WorldPivot = sc.Node.CFrame  
	sc.Node.Orientation -= Vector3.new(0,5,0)
	task.wait(0.1) 
end

i thought that the problem might be the variable placing, but since everything is in a single for loop, i don’t think that’s the case. can anyone tell me the problem with this if they notice it?

The math for the CFrame is the same every time. You need to do something like this:

local s = workspace.sidelane
local nextCFrame = s.CFrame

for i = 1,18 do 
	local sc = s:Clone() 
	sc.Parent = workspace
	sc.Node.CFrame = nextCFrame
	nextCFrame *= CFrame.new(0,0,-13) 
	sc.WorldPivot = sc.Node.CFrame  
	sc.Node.Orientation -= Vector3.new(0,5,0)
	task.wait(0.1) 
end