Welds work strangely

guys i cant set rotation for my lines. if “Yrot” is equal to “(i * (360 / numberOfDots))”, it just dont work normally. but if yrot is equal to for example 55 it WORKS. can someone explain why


-- local numberOfDots = range * 3
		local radius = range
		local dotSize = 0.05
	
		for i = 0, numberOfDots - 1 do
			local angle = (i / numberOfDots) * (2 * math.pi)
			local x = radius * math.cos(angle)
			local z = radius * math.sin(angle)
			
			local yRot = (i * (360 / numberOfDots))

			local dot = Instance.new("Part")
			dot.Material = Enum.Material.Neon
			dot.CanCollide = false
			dot.CanQuery = false
			dot.CanTouch = false

			p.Color = Color3.fromRGB(190, 189, 193)

			dot.Massless = false
			dot.Transparency = 0.2
			dot.Size = Vector3.new(dotSize, 0.005, 1) 
			dot.Parent = tower.Dots
			
			local weld = Instance.new("Weld")
			weld.Part0 = p
			weld.Part1 = dot
			weld.Parent = dot

			dot.Anchored = false
			
			weld.C0 = CFrame.Angles(math.rad(-yRot),0,math.rad(90))
			local targetCFrame = CFrame.new(x, 0, z)
			
			weld.C1 = CFrame.new(0, 0, 0)
			
			local goal = {C1 = targetCFrame}
			
			local Tween = TweenService:Create(weld, TweenInfo.new(0.2, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), goal)
			Tween:Play()
		end

Please help…

2 Likes

Try using a weldconstraint instead?

i want to tween these lines from center. if i use weldconstraint and drag mouse to another place, it will look like this:
image
image

maybe there is some other solution to make this possible. idk, i think we need to use only weld

I think you could use a imagelabel instead :eyes:

1 Like