I have this pretty standard weld function (see below) that welds 2 parts together keeping the original offset of the parts. Here is the strange part: If I feed the function the optional parameter c1 with the EXACT same code otherwise run within the function
part1.CFrame:ToObjectSpace(part0.CFrame)
It will work as intended, if I leave the c1 parameter blank I suddenly get a completely different result for c1 and the one part is simply welded to the center of the other despite the code being the same. I’m really confused by this behavior.
local function WeldTogether(part0: BasePart, part1: BasePart, c1: CFrame)`
local weld = Instance.new("Motor6D", part0)
weld.Part0 = part0
weld.Part1 = part1
weld.C1 = c1 or part1.CFrame:ToObjectSpace(part0.CFrame)
weld.Parent = part0
return weld
end
return WeldTogether