Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

why is this weld weird?

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

local weld = weldBetween(game.Workspace.spe, game.Workspace.eps)

this makes a weld between two parts. it does make the weld, but it puts part1 into the center of part0. im completely new to welds, and this script was even from the wiki. how do i have the parts stay in the right positions?

1 answer

Try this instead

local function weldBetween(a, b)
	    local weld = Instance.new("ManualWeld", a)
	    weld.Part0 = a
	    weld.Part1 = b
	    weld.C0 = a.CFrame:inverse()
	    weld.C1 = b.CFrame:inverse()
	    return weld
end

local weld = weldBetween(game.Workspace.spe, game.Workspace.eps)

3 comments

0

well now the part goes to 0,0,0

0

The inverse cancels out the CFrame

0

yea, but the parts still go weird

This discussion is preserved as it was. New answers, comments, and votes are closed.