Help with radians positioning script shifting

Hey all hope your day is going great!

Right now I am trying to position parts in a funnel/fan shape using radians, but when I do so the left side lines up perfectly, but the right side always shifts like this:

Here is the code I am using:

local angle = 130
rows_sampled = 15
local baseCount = 4

local n = 1

local count = 1

for i = rows_sampled, 1, -1 do
	
	for i = baseCount, 1, -1 do
		count = count + 1
		local part = workspace.Part:Clone()
		part.Name = tostring(i)
		part.SurfaceGui.TextLabel.Text = tostring(count)
		part.CFrame = workspace.Part.CFrame * CFrame.Angles(0, (math.rad(angle/baseCount) * i), 0) * CFrame.new(0, 0, (n * 4))
		part.Parent = workspace
	end
	
	baseCount = baseCount + 1
	
	n = n + 1

end

Does anybody know why the right side won’t line up?

1 Like

for your second for loop:

for i = baseCount, 1, -1 do

Try counting down to 0 instead of 1, I’m pretty sure that will work.

for i = baseCount, 0, -1 do
2 Likes

If you want to keep your previous architecture of going down to 1, you would have to transform i in this part:

* CFrame.Angles(0, (math.rad(angle/baseCount) * i), 0) *

Maybe to something like this:

* CFrame.Angles(0, (math.rad(angle/baseCount) * (i - 1)*baseCount/(baseCount - 1)), 0) *