Skip to content

Water Volume

Updated

Lets the camera go under this water: water-coloured fog as far as its clarity, the waves seen from below, drifting specks.

Type
comp-water-volume
Script class
WaterVolumeComponent
Per entity
One
Version
1.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
clarity 15 1 ≤ x ≤ 100
depth 20 0.1 ≤ x ≤ 10000
particles 0.5 0 ≤ x ≤ 1

Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.

  • WaterVolume::enter
  • WaterVolume::submerge
  • WaterVolume::emerge
  • WaterVolume::exit

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