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

Why do welds change the position and rotation of some of my parts?

Asked by 5 years ago
Edited 5 years ago

So recently I made a welding script for one of my games, but I am trying to figure out why manual welds change the position and orientation of some of the parts in a tool. Here is the script (Server Script):

Parts = Handi:GetChildren()
            PrimaryPart = Handi
            for i = 1, #Parts do
                if Parts[i]:IsA('BasePart') then
                    local weld = Instance.new("Weld")
                    weld.Part0 = PrimaryPart
                    weld.Part1 = Parts[i]
                    weld.C0 = PrimaryPart.CFrame:inverse()
                    weld.C1 = Parts[i].CFrame:inverse()
                    weld.Parent = PrimaryPart
                end
            end

This also happens with a weld plugin I am using: https://gyazo.com/1271e3811455bb87b7205014fb0366d4

How can I avoid changing the parts position and orientation?

Answer this question