Skip to content

Grass

Updated

Wind-blown grass that grows on the entity’s surface.

Type
comp-grass
Script class
GrassComponent
Per entity
One
Version
2.1.0

Read about it in Grass: what it does, how to use it from a script, and examples.

The props the runtime declares for this component, with their defaults and accepted ranges.

Prop Default Range
density 0 ≤ x ≤ 1
dryPatch 0 ≤ x ≤ 1
dryness 0 ≤ x ≤ 1
maxSlope 0 ≤ x ≤ 90
preset "lawn"
windStrength -2 ≤ x ≤ 2

Run it in the browser, read its scripts, and download it as an XR Creator project.

#pragma lifecycle(startup)
function startup() {
const component = self.parent.getComponent(GrassComponent);
if (component) log(component.props);
}