Skip to main content

Zones

Tag a BasePart or Model OceanZone and the sea inside it is its own: any Ocean setting set as an attribute on the zone overrides the module's value there. Weather settings (waves, colours, foam, spray) become that zone's weather, cross-faded across the rim; buoyancy settings blend per assembly the same way. Zones can move and their attributes can change live (they are re-read twice a second).

Zone attributes:

  • any setting name: override of that setting inside the zone
  • OceanBlend: studs of rim over which the sea cross-fades (default 35% of the radius)

The plugin's Zones addon fills these from an Ocean preset and handles lighting on entering and leaving.

Types​

Zone​

interface Zone {
Name: string
Instance: Instance
CFrame: CFrame
Half: Vector3
X: number
Z: number
Radius: number
Blend: number
Overrides: {[string]: any}
}

Functions​

Refresh​

Zones.Refresh() → ()

Re-reads every OceanZone. Runs twice a second on its own.

List​

Zones.List() → {Zone}

Every zone.

At​

Zones.At(position: Vector3) → Zone?

The zone whose box contains the point (the first, if they overlap), or nil.

Value​

Zones.Value(
name: string,
x: number,
z: number
) → number

A numeric setting at (x, z): the module's value pulled toward each zone's override across its rim, with the same fade the sea uses.

Show raw api
{
    "functions": [
        {
            "name": "Refresh",
            "desc": "Re-reads every `OceanZone`. Runs twice a second on its own.",
            "params": [],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 118,
                "path": "src/Ocean/Zones.luau"
            }
        },
        {
            "name": "List",
            "desc": "Every zone.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ Zone }"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 178,
                "path": "src/Ocean/Zones.luau"
            }
        },
        {
            "name": "At",
            "desc": "The zone whose box contains the point (the first, if they overlap), or nil.",
            "params": [
                {
                    "name": "position",
                    "desc": "",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Zone?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 189,
                "path": "src/Ocean/Zones.luau"
            }
        },
        {
            "name": "Value",
            "desc": "A numeric setting at `(x, z)`: the module's value pulled toward each zone's override across its rim,\nwith the same fade the sea uses.",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "x",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "z",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 210,
                "path": "src/Ocean/Zones.luau"
            }
        },
        {
            "name": "Init",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "static",
            "private": true,
            "source": {
                "line": 232,
                "path": "src/Ocean/Zones.luau"
            }
        },
        {
            "name": "Stop",
            "desc": "",
            "params": [],
            "returns": [],
            "function_type": "static",
            "private": true,
            "source": {
                "line": 250,
                "path": "src/Ocean/Zones.luau"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "Zone",
            "desc": "",
            "fields": [
                {
                    "name": "Name",
                    "lua_type": "string",
                    "desc": ""
                },
                {
                    "name": "Instance",
                    "lua_type": "Instance",
                    "desc": ""
                },
                {
                    "name": "CFrame",
                    "lua_type": "CFrame",
                    "desc": ""
                },
                {
                    "name": "Half",
                    "lua_type": "Vector3",
                    "desc": ""
                },
                {
                    "name": "X",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "Z",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "Radius",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "Blend",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "Overrides",
                    "lua_type": "{ [string]: any }",
                    "desc": ""
                }
            ],
            "source": {
                "line": 51,
                "path": "src/Ocean/Zones.luau"
            }
        }
    ],
    "name": "Zones",
    "desc": "Tag a BasePart or Model `OceanZone` and the sea inside it is its own: any Ocean setting set as an\nattribute on the zone overrides the module's value there. Weather settings (waves, colours, foam,\nspray) become that zone's weather, cross-faded across the rim; buoyancy settings blend per assembly\nthe same way. Zones can move and their attributes can change live (they are re-read twice a second).\n\nZone attributes:\n- any setting name: override of that setting inside the zone\n- `OceanBlend`: studs of rim over which the sea cross-fades (default 35% of the radius)\n\nThe plugin's Zones addon fills these from an Ocean preset and handles lighting on entering and leaving.",
    "source": {
        "line": 38,
        "path": "src/Ocean/Zones.luau"
    }
}