Class · inherits Instance
WeldConstraint
Connects two BaseParts together such that their relative
position and orientation remain the same.
About WeldConstraint
WeldConstraint connects two BaseParts and ensures they
stay in the same relative position/orientation to each other, meaning that if
one part moves, the other moves the same amount. Even if the two parts are not
touching, they can be welded together.
The most common way to create a weld constraint is by selecting Weld through Studio's Create menu in the toolbar's Model tab.
Note that this 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 Behavior
Moving a welded BasePart behaves 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.
Properties 4
Active
: booleanReadOnlyNotReplicatedIndicates if the WeldConstraint is currently active in the world.True if the WeldConstraint is currently active in the world.
If the WeldConstraint or one of its parts is not in
Workspacethe weld will be inactive.Rigid joints like
Weld,Snap,WeldConstraint,Motor, orMotor6Dmay also be disabled due to conflicts with other rigid joints, such as joints between the same two parts or indirect cycles in the weld graph. Joints disabled this way may be re-enabled later when another joint or part is added or removed.Duplicate WeldConstraints do not conflict because WeldConstraints derive their internal CFrames from the relative positions of their parts when they are enabled and all update when
BasePart.PositionorBasePart.Orientationis set on a part. The spanning tree may still disable them if they are redundant or form a cycle.Enabled
: booleanNotReplicatedToggles the constraint on and off.The Enabled property of a
WeldConstraintsets whether the constraint is active or not. When this property is set to true, if the constraint'sWeldConstraint.Part0andWeldConstraint.Part1properties are set, then the constraint will ensure that its two connected parts will be locked together.Part0
: BasePartNotReplicatedThe first part connected by the constraint.The
Part0andWeldConstraint.Part1properties of aWeldConstraintset which twoBasePartthe weld connects. As soon as both properties are set and the weld isWeldConstraint.Enabled, the weld will lock the two parts together.If
Part0orPart1are ever set to new parts, then theWeldConstraintwill instantly link the new part. The old part will no longer be constrained.Part1
: BasePartNotReplicatedThe second part connected by the constraint.The
WeldConstraint.Part0andPart1properties of aWeldConstraintset which twoBasePartthe weld connects. As soon as both properties are set and the weld isWeldConstraint.Enabled, the weld will lock the two parts together.If
Part0orPart1are ever set to new parts, then theWeldConstraintwill instantly link the new part. The old part will no longer be constrained.
WeldConstraint also has every member of Instance. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.