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

I welded my Items but when moved it falls APART!?

Asked by
Tizzel40 243 Moderation Voter
5 years ago

I welded all my Items with simple script

for i,v in pairs(script.Parent:GetChildren()) do
    if v:IsA("BasePart") or v:IsA("UnionOperation") then

        local handle = script.Parent:WaitForChild("Handle")
        local weild = Instance.new("Weld",v)
     weild.Part0 = v
    weild.Part1 = handle
    weild.C0 = v.CFrame:inverse()
    weild.C1 = handle.CFrame:inverse()
    end
end

but when I equip my weapon and use the "zyx" moving tool to move the handle and it Falls right Apart!!!!!!! why is this happening!? is there a way to prevent it from happening and make it stick to the part

0
just so you know when its equiped its welded and in place Tizzel40 243 — 5y
0
Try removing the .CFrame:inverse() Leamir 3138 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
function Weld(p1, p2)
    local w = Instance.new("Weld", game.JointsService)
    w.C1 = p1.CFrame:toObjectSpace(p2.CFrame)
    w.Part0 = p2  
    w.Part1 = p1
end

Weld(0,0) -- The zeroes represent the two parts you want to weld
Ad

Answer this question