Physics Prismatic Joint
Updated
Slider joint along one axis, like a drawer.
- Type
comp-physics-prismatic-joint- Script class
PhysicsPrismaticJointComponent- 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 |
|---|---|---|
anchor |
||
anchor.x |
- |
|
anchor.y |
- |
|
anchor.z |
- |
|
axis.x |
||
axis.y |
||
axis.z |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
A high striker on a Prismatic JointA fairground high striker: the puck rides a Prismatic Joint that lets it slide only along the pole. Every few seconds the script strikes it upward with a random impulse and logs how high it went; a hard hit rings the bell.
Watch the puck shoot up the pole and slide back down, staying on its axis whatever the impulse. 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(PhysicsPrismaticJointComponent); if (component) log(component.props);}