Grass Bender
Updated
Makes grass bend away as this entity moves through it.
- Type
comp-grass-bender- Script class
GrassBenderComponent- Per entity
- One
- Version
- 1.1.0
Read about it in Grass: 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 |
|---|---|---|
offsetY |
- |
|
radius |
0 ≤ x ≤ 100 |
|
strength |
0 ≤ x ≤ 4 |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Let the player part the grass, and make the wind gustBalls roll down a meadow and part the grass with their Grass Benders, as in the runtime Sky & Terrain demo; the script gives the camera a bender of its own and makes the wind gust every few seconds.
Watch the balls roll down the hill and push the grass aside, and the meadow sway harder when a gust comes. 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(GrassBenderComponent); if (component) log(component.props);}