RopeConstraint
Keeps two parts at most a given distance apart: swings, tethers and chains.
- Inherits: Constraint → Instance
- Creatable: Yes:
new RopeConstraint(), orInstance.new('RopeConstraint', parent). - Replication: Replicated: clients get a copy, and changes the server makes reach them.
The parts can move freely until the rope between the pivots is taut. The two parts still collide with each other.
Properties
Section titled “Properties”pivot0
Section titled “pivot0”Type: Vector3 · Default: new Vector3(0, 0, 0) · Access: read/write · Replicates: yes
Where the joint attaches to part0, relative to its center (in the part’s own axes).
pivot1
Section titled “pivot1”Type: Vector3 · Default: new Vector3(0, 0, 0) · Access: read/write · Replicates: yes
Where the joint attaches to part1, relative to its center (in the part’s own axes).
length
Section titled “length”Type: number · Default: 10 · Range: 0 to 10,000 (clamped) · Access: read/write · Replicates: yes
Maximum distance in studs.
Inherited from Constraint: part0, part1, enabled
Inherited from Instance: name, archivable, id, className, parent, destroyed
Methods
Section titled “Methods”Inherited from Instance: getPropertyChangedSignal, setAttribute, getAttribute, getAttributes, getAttributeChangedSignal, getChildren, getDescendants, findFirstChild, findFirstChildOfClass, findFirstChildWhichIsA, findFirstAncestor, findFirstAncestorWhichIsA, waitForChild, isA, isDescendantOf, isAncestorOf, getFullName, clearAllChildren, destroy, clone, toString
Events
Section titled “Events”Inherited from Instance: changed, childAdded, childRemoved, descendantAdded, descendantRemoving, ancestryChanged, destroying, attributeChanged
Examples
Section titled “Examples”A swing
Section titled “A swing”import { Part, RopeConstraint, Vector3, workspace } from '@rally/sdk';
const beam = new Part();beam.size = new Vector3(8, 1, 1);beam.position = new Vector3(0, 20, 0);beam.parent = workspace;
const seat = new Part();seat.size = new Vector3(3, 0.5, 2);seat.position = new Vector3(0, 12, 0);seat.anchored = false;seat.parent = workspace;
const rope = new RopeConstraint();rope.part0 = beam;rope.part1 = seat;rope.length = 8;rope.pivot1 = new Vector3(0, 0.25, 0); // top of the seatrope.parent = beam;