Water Foam
Updated
Makes water foam where this entity meets the water, and in its wake as it moves through it.
- Type
comp-water-foam- Script class
WaterFoamComponent- Per entity
- One
- Version
- 1.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 |
|---|---|---|
offsetY |
0 |
- |
radius |
0.6 |
0 ≤ x ≤ 1000 |
shape |
"sphere" |
|
strength |
1 |
0 ≤ x ≤ 1 |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
A mini pool you can dive intoA garden pool of clear water: caustic light dances on its tiled floor, the walls are wet at the waterline, a beach ball bobs with foam round it, and a Water Volume lets the camera go under the surface.
Drag to orbit round the pool. Scroll in to dive under the surface: the water fogs the view, bubbles drift past and caustics play on the floor. Scroll out to come back up.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(WaterFoamComponent); if (component) log(component.props);}