Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
Weld
A WeldConstraint connects two BaseParts and ensures they stay in the same relative position and orientation to each other. Even if the two parts are not touching, you can weld them together.
Note
To attach two Attachments or Bones, versus two BaseParts, see RigidConstraint.
Unique to WeldConstraint are slight behavioral differences in how Studio handles creation and repositioning of welded parts.
Weld Creation
When creating a WeldConstraint using Studio's Constraint button, the tool behaves differently depending on how many BaseParts are selected when the tool is activated:
- If no
BasePartsare selected, the next twoBasePartsclicked will be connected by a newWeldConstraint. If the sameBasePartis clicked twice, no constraint will be created. - If one
BasePartis already selected, the nextBasePartclicked will be connected to the selected one with a newWeldConstraint. - If multiple
BasePartsare selected, those which are touching or overlapping will be automatically welded together by newWeldConstraints.
Repositioning Welded Parts
Roblox handles moving a welded part differently depending on whether the part was moved through its Position or through its CFrame.
If a welded part's
Positionis updated, that part will move but none of the connected parts will move with it. The weld will recalculate the offset from the other parts based on the moved part's new position.If a welded part's
CFrameis updated, that part will move and all of the connected parts will also move, ensuring they maintain the same offset as when the weld was created.