Dynamic Spring Bone
Updated
One bone springs and overshoots: tails, jiggle.
- Type
comp-dynamic-spring-bone- Script class
DynamicSpringBoneComponent- Per entity
- Several
- Version
- 2.0.0
Read about it in Dynamic bones: 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 |
|---|---|---|
damping |
0 ≤ x ≤ 10000 |
|
mass |
0. |
|
stiffness |
10 ≤ x ≤ 100000 |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Shake a springy stickA script adds Dynamic Spring Bone components to the bones of a loaded stick, then swings the stick from side to side so its tip lags and whips behind.
Watch the tip lag behind. Click the scene and press Space to stop the shaking and watch the stick settle. 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(DynamicSpringBoneComponent); if (component) log(component.props);}