Terrain
Updated
Procedural terrain from one displaced grid, paintable with textures.
- Type
comp-terrain- Script class
TerrainComponent- Per entity
- One
- Version
- 1.2.0
Read about it in Terrain: 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 |
|---|---|---|
heightScale |
-10 ≤ x ≤ 10 |
|
seed |
||
size |
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
Dig and raise the ground under the pointerHolding R, F or G sculpts the terrain under the mouse every frame with sculptAt, raising, lowering or smoothing it; releasing the key commits the change.
Point at the ground and hold R to raise it, F to lower it or G to smooth it. 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(TerrainComponent); if (component) log(component.props);}