Geometry
Updated
A built-in primitive shape: box, sphere, plane, cylinder, ring and more.
- Type
comp-geometry- Script class
GeometryComponent- Per entity
- One
- Version
- 1.1.0
Read about it in Models and meshes: 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 |
|---|---|---|
params. |
1 ≤ x ≤ 16, integer |
|
params.depth |
0 ≤ x ≤ 10000 |
|
params.detail |
0 ≤ x ≤ 16, integer |
|
params.height |
0 ≤ x ≤ 10000 |
|
params. |
2 ≤ x ≤ 32, integer |
|
params. |
0 ≤ x ≤ 10000 |
|
params.length |
0 ≤ x ≤ 10000 |
|
params. |
0 ≤ x ≤ 10000 |
|
params. |
3 ≤ x ≤ 64, integer |
|
params.radius |
0 ≤ x ≤ 10000 |
|
params. |
0 ≤ x ≤ 10000 |
|
params. |
0 ≤ x ≤ 10000 |
|
params. |
3 ≤ x ≤ 64, integer |
|
params. |
- |
|
params. |
3 ≤ x ≤ 64, integer |
|
params.tube |
0 ≤ x ≤ 10000 |
|
params. |
3 ≤ x ≤ 128, integer |
|
params.width |
0 ≤ x ≤ 10000 |
|
params. |
3 ≤ x ≤ 64, integer |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Bob an object up and downYour first script: a Behavior under a sphere bobs it around its starting height, with the height and period as editor slots.
Watch the ball bob. 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(GeometryComponent); if (component) log(component.props);}