Skip to content

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.

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.01 ≤ x ≤ 100
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.1 ≤ x ≤ 1000
windDirection 0

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(WaterMeshComponent);
if (component) log(component.props);
}