local radius=newGear.PrimaryPart.Size.Magnitude
local circle=math.pi*2
for i=1,GearTeethCount do
local angle=circle/GearTeethCount*i
local x_pos = math.cos(angle) *radius
local y_pos = math.sin(angle) * radius
local p=Instance.new('Part',newGear.Teeth)
p.Size=Vector3.new(GearTeethThickness,GearTeethHeight,GearRadius/GearTeethCount)
p.CFrame=CFrame.lookAt(GearPosition.Position + Vector3.new(0,x_pos,y_pos)/(2+GearTeethHeight),GearPosition.Position) * CFrame.Angles(math.rad(90),0,0)
p.Anchored=true
end
````
it should create a gear that i can then use to build mechanisms and stuff, but you see that the upper middle tooth is rotated incorrectly to all others