uh oh
TLDR; tryna make n number of lines shoot out from the root part with a specific spread angle and length.
okay so the issue is the weld, i need to use welds. but welds are not cooperating, woe is me.
really cool picture of what’s happening
i’m using welds and ngl idrk how to use welds so would be very very very much appreciated if you can help a brother out yk
look at weld.C0 line b
just run this in studio and it’ll work / not work cause it’s not what i want would like
but you’ll get what’s in the image
--IGNORE
game:GetService('Lighting').ClockTime = 0
for _, v in ipairs(workspace:GetDescendants()) do if v:IsA('BasePart') then v:Destroy() end end
--IGNORE
--FOCUS
-- DOWN
-- HERE
-- |||
-- |||
-- |||
-- ˅˅˅
local n = 17
local spread = 90
local length = 100
local root = Instance.new('Part')
root.Color, root.Material, root.Size = Color3.fromRGB(255, 255, 255), Enum.Material.ForceField, 4 * Vector3.one
root.CanCollide, root.Anchored, root.Shape = false, true, Enum.PartType.Ball
root.Parent = workspace
local indicators = Instance.new('Folder');indicators.Name='indicators';indicators.Parent=workspace -- ignore
for i = 0, n - 1 do
local indicator = Instance.new('Model');indicator.Name=(('%%0%dd'):format(#tostring(n))):format(1+i);indicator.Parent=indicators -- ignore
local line = Instance.new('Part')
line.Color = Color3.fromRGB(255, 0, 255)
line.Material = Enum.Material.ForceField
line.Transparency = 0.5
line.Size = Vector3.new(length, 0.2, 0.2)
line.Name = 'line'
line.CanCollide = false
line.Shape = Enum.PartType.Cylinder
line.Parent = indicator
local weld = Instance.new("Weld")
weld.C0 = CFrame.new(length / 2, 0, 0) * CFrame.Angles(0, math.rad(-spread / 2 + (spread / (n - 1)) * i), 0) -- WTFFFFFFFFFFFFF
weld.Part0 = root
weld.Part1 = line
weld.Parent = line
end