LOD Mesh
Updated
One detail level inside a LOD Group, shown from a set distance.
- Type
comp-lod-mesh- Script class
LODMeshComponent- Per entity
- One
- Version
- 1.0.0
Read about it in LOD and caching: 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 |
|---|---|---|
distance |
0 |
0 ≤ x ≤ 10000 |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Log LOD switches while you tune distancesA grove of trees with three levels of detail each: amber and detailed near, blue and coarse further out, a violet cone far away. The script logs every switch of the first tree with the camera's distance.
Scroll to zoom out and in, and watch the trees swap levels and the log report each switch of the front tree. Drag to orbit the camera.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(LODMeshComponent); if (component) log(component.props);}