> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rollingquest.kramgames.com/llms.txt
> Use this file to discover all available pages before exploring further.

# LavaPool — Liquid Pool Controller API Reference

> API reference for the LavaPool class in RollingQuest Lua scripting. Control lava or liquid pool height, mode, velocity, amplitude, and frequency.

The `LavaPool` class controls a liquid pool (lava, water, etc.) in the level. The pool can operate in several modes — disabled, static, auto-adjusting, or tide — and exposes parameters for height, velocity, amplitude, and frequency. You access the pool via `Level.lavaPool` during gameplay.

> **Related type:** The editor-side configuration is handled by [`PoolData`](/api/classes/pool-data). The mode enum is [`PoolMode`](/api/enums/other-enums).

## Properties

| Property        | Type       | Read/Write   | Description                              |
| --------------- | ---------- | ------------ | ---------------------------------------- |
| `isActive`      | `boolean`  | ✅ Read       | `true` if the pool is currently active.  |
| `mode`          | `PoolMode` | ❌ Read/Write | Current pool behavior mode.              |
| `currentHeight` | `number`   | ❌ Read/Write | Current height of the liquid surface.    |
| `targetHeight`  | `number`   | ❌ Read/Write | Target height the pool is moving toward. |

### AutoAdjust Parameters

These properties are used when `mode` is `PoolMode.AutoAdjust`:

| Property       | Type     | Read/Write   | Description                                               |
| -------------- | -------- | ------------ | --------------------------------------------------------- |
| `velocity`     | `number` | ❌ Read/Write | Speed at which the pool adjusts toward the target height. |
| `maxVelocity`  | `number` | ❌ Read/Write | Maximum adjustment speed.                                 |
| `acceleration` | `number` | ❌ Read/Write | Acceleration rate for pool height changes.                |

### Tide Parameters

These properties are used when `mode` is `PoolMode.Tide`:

| Property    | Type     | Read/Write   | Description                         |
| ----------- | -------- | ------------ | ----------------------------------- |
| `amplitude` | `number` | ❌ Read/Write | Height variation of the tide cycle. |
| `frequency` | `number` | ❌ Read/Write | Speed of the tide oscillation.      |

## Usage Example

Configure a rising tide effect when the player enters a danger zone:

```lua theme={null}
function OnBallRoll(self, rollIn, side, ball)
    if self.tag ~= "lava_trigger" then return end

    local pool = Level.lavaPool
    pool.mode = PoolMode.Tide
    pool.amplitude = 3.0
    pool.frequency = 0.5
    pool.targetHeight = 5.0

    Logger.info("Lava tide activated!")
end
```

Set the pool to auto-adjust toward a specific height:

```lua theme={null}
function OnStart()
    local pool = Level.lavaPool
    pool.mode = PoolMode.AutoAdjust
    pool.targetHeight = 2.0
    pool.velocity = 1.0
    pool.acceleration = 0.5
end
```
