WeldConstraint
Connects two BaseParts together such that their relative position and orientation remain the same.
Memory category | PhysicsParts |
---|
Member index 9
Description
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 Model tab.
Note that this tool behaves differently depending on how many BaseParts are selected when the tool is activated:
- If no BaseParts are selected, the next two BaseParts clicked will be connected by a new WeldConstraint. If the same BasePart is clicked twice, no constraint will be created.
- If one BasePart is already selected, the next BasePart clicked will be connected to the selected one with a new WeldConstraint.
- If multiple BaseParts are selected, those which are touching or overlapping will be automatically welded together by new WeldConstraints.
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 Position is 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 CFrame is 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.
History 29
- 553 Add
- 553 Add
- 553 Change Default of Part1 from to
- 553 Add
- 553 Change Default of Part0 from to
- 553 Change Default of Enabled from to true
- 553 Add
- 553 Add
- 553 Change Default of Active from to false
- 486 Change ThreadSafety of Part1 from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Part0 from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Enabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Active from ReadOnly to ReadSafe
- 468 Change Tags of Enabled from [] to [NotReplicated]
- 468 Change CanSave of Enabled from true to false
- 462 Change ThreadSafety of Part1 from to ReadOnly
- 462 Change ThreadSafety of Part0 from to ReadOnly
- 462 Change ThreadSafety of Enabled from to ReadOnly
- 462 Change ThreadSafety of Active from to ReadOnly
- 454 Change MemoryCategory of WeldConstraint from Instances to PhysicsParts
- 452 Change MemoryCategory of WeldConstraint from PhysicsParts to Instances
- 453 Change MemoryCategory of WeldConstraint from Instances to PhysicsParts
- 360 Add Active
- 329 Change ValueType of Part1 from Object to BasePart
- 329 Change ValueType of Part0 from Object to BasePart
- 299 Add Part1
- 299 Add Part0
- 299 Add Enabled
- 299 Add WeldConstraint
Members 9
Active
Type | Default | |
---|---|---|
bool | false |
True if the WeldConstraint is currently active in the world.
If the WeldConstraint or one of its parts is not in Workspace the weld will be inactive.
Rigid joints like Weld, Snap, WeldConstraint, Motor, or Motor6D may 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.Position or BasePart.Orientation is set on a part. The spanning tree may still disable them if they are redundant or form a cycle.
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | false/true |
Enabled
Type | Default | |
---|---|---|
bool | true |
The Enabled property of a WeldConstraint sets whether the constraint is active or not. When this property is set to true, if the constraint's WeldConstraint.Part0 and WeldConstraint.Part1 properties are set, then the constraint will ensure that its two connected parts will be locked together.
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true/false |
Part0
Type | Default | |
---|---|---|
BasePart |
The Part0 and WeldConstraint.Part1 properties of a WeldConstraint set which two BasePart the weld connects. As soon as both properties are set and the weld is WeldConstraint.Enabled, the weld will lock the two parts together.
If Part0 or Part1 are ever set to new parts, then the WeldConstraint will instantly link the new part. The old part will no longer be constrained.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Thread safety | ReadSafe |
---|---|
Category | Parts |
Loaded/Saved | true/false |
Part1
Type | Default | |
---|---|---|
BasePart |
The WeldConstraint.Part0 and Part1 properties of a WeldConstraint set which two BasePart the weld connects. As soon as both properties are set and the weld is WeldConstraint.Enabled, the weld will lock the two parts together.
If Part0 or Part1 are ever set to new parts, then the WeldConstraint will instantly link the new part. The old part will no longer be constrained.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Thread safety | ReadSafe |
---|---|
Category | Parts |
Loaded/Saved | true/false |