I am trying to Weld a part to a player when they join the game, but the part just sits on the baseplate.

local function weldBetween(a, b)
    print(a, b)
    local weld = Instance.new("Weld", a)
    weld.Part0 = a
    weld.Part1 = b
    weld.C0 = a.CFrame:inverse() * b.CFrame

 a.LocalTransparencyModifier = 0

    return weld
end

game.Players.PlayerAdded:connect(function(plr)
    plr.CharacterAdded:connect(function(chr)
    chr:WaitForChild( "Torso" )
        local part = Instance.new("Part", game.Workspace)
        part.Name = "Welded Part"
        part.Size = Vector3.new(2,2,2)
    part.CFrame = chr.Torso.CFrame -- Position it somewhere, or else it will spawn at 0,0,0 and weld to player from that distance

        local weld = weldBetween(part, chr.Torso)
    end)
end)

2 comments

0

Is the part anchored?

0

If the part was anchored, the player wouldn't be able to move, so no.