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

Why does my weld disappear when I set Part1?

Asked by 6 years ago

I am trying to attach any part to my character using a ManualWeld and for some reason it doesn't work.

Here's my code:

player.CharacterAdded:connect(function(character)
    local UpperTorso = character:WaitForChild("UpperTorso", 5)
    if UpperTorso then
        local weld = Instance.new("ManualWeld", UpperTorso)
        weld.Part0 = UpperTorso
        weld.Part1 = game.Workspace.Brick
    end
end)

For some reason if I remove Part1 then it appears in UpperTorso, but if I set Part1 to anything, the weld disappears from UpperTorso and doesn't work. Thanks in advance.

1 answer

Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
6 years ago

Set the weld's parent after all other properties are set. Or else thing happen before you want them to.

Ad

Answer this question