Water Mesh
Updated
Real-time water surface with waves, foam, rain, reflections and caustics.
- Type
comp-water-mesh- Script class
WaterMeshComponent- Per entity
- One
- Version
- 2.2.0
Read about it in Water: 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 |
|---|---|---|
caustics |
0.8 |
0 ≤ x ≤ 1 |
clarity |
3 |
0. |
color |
"#0e4d64" |
|
foam |
0.5 |
0 ≤ x ≤ 1 |
rain |
0 |
0 ≤ x ≤ 1 |
rainSize |
0.2 |
0.05 ≤ x ≤ 2 |
size |
20 |
0 ≤ x ≤ 10000 |
waveHeight |
0.3 |
0.01 ≤ x ≤ 20 |
waveLength |
8 |
0. |
windDirection |
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
Raise a storm over the seaOne tween changes wave height, foam and rain together on four ocean tiles, turning a calm sea into a storm and back.
Press Storm to raise the waves over twelve seconds, and Calm to let them settle. 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(WaterMeshComponent); if (component) log(component.props);}