Physics Rope Joint
Updated
Keeps bodies within a maximum distance, like a rope.
- Type
comp-physics-rope-joint- Script class
PhysicsRopeJointComponent- Per entity
- One
- Version
- 2.0.0
Read about it in Joints: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
length |
0. |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Cut the ropeA chandelier swings from a fixed hook on a Rope Joint; pressing the button raises cut and the script disables the joint, so the chandelier falls.
Press Cut the rope. Drag to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(PhysicsRopeJointComponent); if (component) log(component.props);}