Are WeldConstraints reliable with non-stationary parts?

I need to weld armor to characters, but the character will be moving, and the armor part is unanchored

WeldConstraints are easier to use, but I’m uncertain if they will always weld properly

my current implementation

local armorPartClone = armorPart:Clone()
armorPartClone.CFrame = matchingBodyPartCFrame * relativeCFrame
local weld = Instance.new("WeldConstraint")
weld.Part0 = armorPartClone
weld.Part1 = matchingBodyPart
weld.Parent = armorPartClone
armorPartClone.Parent = armorFolder

since I’m setting the CFrame before the weld is created, is there any chance that the armor part will end up in a slightly different position due to delay

I haven’t experienced this yet, but I’m curious if this is an edge case or not

If this is the case, then I’ll swap to using regular Welds

There should be no issue with this. I’d advise just testing and see how it goes with some sort of case where you put a ‘wait’ before parenting the weld or parenting the armorPartClone.

I’ve used WeldConstraints before and have never come across this issue.

There should be no issues as code cannot run at the same time as physics.

2 Likes

No. WeldConstraints have internal properties CFrame0 and CFrame1 that act like a weld’s C0 and C1. When a WeldConstraint is created by the server, these properties get replicated (the client does not produce their own offsets). As a result, the client will still have a perfectly welded part.

However, I still personally prefer Welds when using scripts, as it feels completely hacky and imprecise to reposition a part first, then parent the WeldConstraint hoping that everything will be handled automatically. Even though in theory there is nothing to worry about, Welds give me concrete offsets to configure and I am guaranteed the weld will do exactly what I tell it to.

1 Like