Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my welding script welding the CFrame incorrectly?

Asked by 5 years ago

I make small alterations to the weld.C0 and weld.C1, but whatever I do my parts are always welded in the wrong orientation or position

Can someone take a look at my welding script and see where I am going wrong?? This script is a normal server script, that is located inside of a brick part (base part)

Handi = script.Parent:FindFirstChild('Handi')
Parts = Handi:GetChildren()
for i = 1, #Parts do
    if Parts[i]:IsA('BasePart') then
        local weld = Instance.new("Weld")
        weld.Part0 = Handi
        weld.Part1 = Parts[i]
        -- Here is where I make changes. I think this is where I am having problems.
        weld.C0 = Handi.CFrame:inverse() * Handi.CFrame
        weld.C1 = Parts[i].CFrame:inverse() * Handi.CFrame
        weld.Parent = Handi
    end
end

Answer this question