How can I make this work for Unions so not only parts will be welded?
local prev
local parts = script.Parent:GetChildren()
for i = 1,#parts do
if (parts[i].className == "Part") then
if parts[i].Name ~= "Part" then
if (prev ~= nil)then
local weld = Instance.new("Weld")
weld.Part0 = prev
weld.Part1 = parts[i]
weld.C0 = prev.CFrame:inverse()
weld.C1 = parts[i].CFrame:inverse()
weld.Parent = prev
end
prev = parts[i]
end
end
end
for i = 1,#parts do
if (parts[i].className == "Part") then
if parts[i].Name == "Left Leg" or parts[i].Name == "Right Leg" then
parts[i].CanCollide = true
end
if parts[i].Name ~= "Part" then
parts[i].Anchored = false
end
end
end

2 comments
Still not working
Does it weld normal parts?