Skip to content

Constraint

The base class of physics joints between two parts: weld, hinge, spring and rope.

Create a constraint, point part0 and part1 at two parts and parent it anywhere in the Workspace (inside the model it belongs to keeps things tidy). An anchored part holds still, so a constraint to an anchored part pins the other part to the world.

Constraints act only on the game server; players see the parts move through replication. A constraint does nothing while either part is missing or outside the Workspace, when both are the same part, or when both are anchored. Destroying a constraint, or moving it out of the Workspace, lets the parts go.

In 2D games everything stays on the X/Y plane: offsets ignore z, and hinges always turn around Z.

Type: BasePart | null · Default: null · Access: read/write · Replicates: yes

The first part.

Type: BasePart | null · Default: null · Access: read/write · Replicates: yes

The second part.

Type: boolean · Default: true · Access: read/write · Replicates: yes

Set false to let the parts go (and true to rejoin).

false lets the parts go; true joins them again.

Inherited from Instance: name, archivable, id, className, parent, destroyed

Inherited from Instance: getPropertyChangedSignal, setAttribute, getAttribute, getAttributes, getAttributeChangedSignal, getChildren, getDescendants, findFirstChild, findFirstChildOfClass, findFirstChildWhichIsA, findFirstAncestor, findFirstAncestorWhichIsA, waitForChild, isA, isDescendantOf, isAncestorOf, getFullName, clearAllChildren, destroy, clone, toString

Inherited from Instance: changed, childAdded, childRemoved, descendantAdded, descendantRemoving, ancestryChanged, destroying, attributeChanged