Volume
Defined in: server/api.d.ts:2301
A replicated trigger volume. Every client realises it as a native physics sensor, so entry and exit are detected by the game engine rather than polled, and raise volumeHit and volumeLeave.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Volume(
id):Volume
Defined in: server/api.d.ts:2306
Creates a script wrapper for an existing volume with this ID; use Volume.sphere or Volume.box to create one.
Parameters
Section titled “Parameters”number
Network entity identifier.
Returns
Section titled “Returns”Volume
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”contains()
Section titled “contains()”contains(
player):boolean
Defined in: server/api.d.ts:2399
Reports whether a player is currently inside.
Parameters
Section titled “Parameters”player
Section titled “player”number | Player
Player handle or network id to test.
Returns
Section titled “Returns”boolean
True when that player’s client last reported entering and has not reported leaving.
destroy()
Section titled “destroy()”destroy():
void
Defined in: server/api.d.ts:2337
Destroys this volume. Every client drops its sensor, and nobody is left recorded inside.
Returns
Section titled “Returns”void
getPlayers()
Section titled “getPlayers()”getPlayers():
Player[]
Defined in: server/api.d.ts:2383
Lists the players currently inside, as their own clients’ sensors reported them.
Returns
Section titled “Returns”Player[]
The players inside the volume.
isInside()
Section titled “isInside()”isInside(
x,y,z):boolean
Defined in: server/api.d.ts:2392
Tests a world-space point against the volume’s shape. This is a geometric test: unlike contains() it consults no occupancy, works for a point nobody is standing on, and is unaffected by setEnabled.
Parameters
Section titled “Parameters”number
World-space X coordinate to test.
number
World-space Y coordinate to test.
number
World-space Z coordinate to test.
Returns
Section titled “Returns”boolean
True when the point lies inside the shape.
setEnabled()
Section titled “setEnabled()”setEnabled(
enabled):void
Defined in: server/api.d.ts:2343
Enables or disables the volume. A disabled volume holds nobody inside, so anyone in it leaves first.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
False to drop the sensor on every client.
Returns
Section titled “Returns”void
setPosition()
Section titled “setPosition()”setPosition(
x,y,z):void
Defined in: server/api.d.ts:2351
Moves the volume. Every client rebuilds its sensor at the new position.
Parameters
Section titled “Parameters”number
World-space X coordinate of the centre.
number
World-space Y coordinate of the centre.
number
World-space Z coordinate of the centre.
Returns
Section titled “Returns”void
setRadius()
Section titled “setRadius()”setRadius(
radius):void
Defined in: server/api.d.ts:2363
Resizes a sphere volume. Ignored by a box.
Parameters
Section titled “Parameters”radius
Section titled “radius”number
Sphere radius in world units.
Returns
Section titled “Returns”void
setRotation()
Section titled “setRotation()”setRotation(
rotation):void
Defined in: server/api.d.ts:2357
Reorients a box volume. The engine applies this to the sensor’s matrix, so the box is genuinely oriented rather than axis-aligned. Ignored by a sphere.
Parameters
Section titled “Parameters”rotation
Section titled “rotation”a Quaternion, or a Vector3 of Euler angles in radians
Returns
Section titled “Returns”void
setSize()
Section titled “setSize()”setSize(
width,depth,height):void
Defined in: server/api.d.ts:2371
Resizes a box volume. These are full extents, not half-extents. Ignored by a sphere.
Parameters
Section titled “Parameters”number
Full size along the volume’s local X axis.
number
Full size along the volume’s local Y axis.
height
Section titled “height”number
Full size along the volume’s local Z axis.
Returns
Section titled “Returns”void
setVirtualWorld()
Section titled “setVirtualWorld()”setVirtualWorld(
virtualWorld):void
Defined in: server/api.d.ts:2377
Moves the volume to a virtual world. Clients in another world never build its sensor, so it cannot fire for them.
Parameters
Section titled “Parameters”virtualWorld
Section titled “virtualWorld”number
Virtual world the volume exists in.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”setVisibleTo()
Section titled “setVisibleTo()”setVisibleTo(
player):void
Defined in: server/api.d.ts:4160
Restricts replication of this entity to one owning connection while preserving normal range and visibility checks.
Parameters
Section titled “Parameters”player
Section titled “player”Entity | null
Player-owned entity whose connection should exclusively receive this entity, or null to clear the restriction.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”toString()
Section titled “toString()”toString():
string
Defined in: server/api.d.ts:2332
Returns a readable representation of this volume.
Returns
Section titled “Returns”string
The volume ID and shape formatted for logging or debugging.
Inherited from
Section titled “Inherited from”
staticbox(x,y,z,width,depth,height,rotation?,virtualWorld?):Volume
Defined in: server/api.d.ts:2424
Creates a box trigger volume, realised on every client as a native box sensor. The rotation orients the box itself, which is what a city block or a building footprint needs.
Parameters
Section titled “Parameters”number
World-space X coordinate of the centre.
number
World-space Y coordinate of the centre.
number
World-space Z coordinate of the centre.
number
Full size along the volume’s local X axis.
number
Full size along the volume’s local Y axis.
height
Section titled “height”number
Full size along the volume’s local Z axis.
rotation?
Section titled “rotation?”a Quaternion, or a Vector3 of Euler angles in radians
virtualWorld?
Section titled “virtualWorld?”number
Optional virtual world the volume exists in.
Returns
Section titled “Returns”Volume
The new volume.
getAll()
Section titled “getAll()”
staticgetAll():Volume[]
Defined in: server/api.d.ts:2430
Lists every live volume.
Returns
Section titled “Returns”Volume[]
All volumes currently replicated by the server.
sphere()
Section titled “sphere()”
staticsphere(x,y,z,radius,virtualWorld?):Volume
Defined in: server/api.d.ts:2410
Creates a sphere trigger volume, realised on every client as a native sphere sensor.
Parameters
Section titled “Parameters”number
World-space X coordinate of the centre.
number
World-space Y coordinate of the centre.
number
World-space Z coordinate of the centre.
radius
Section titled “radius”number
Radius in world units.
virtualWorld?
Section titled “virtualWorld?”number
Optional virtual world the volume exists in.
Returns
Section titled “Returns”Volume
The new volume.
Properties
Section titled “Properties”enabled
Section titled “enabled”
readonlyenabled:boolean
Defined in: server/api.d.ts:2316
Whether clients currently hold a sensor for this volume.
readonlyid:number
Defined in: server/api.d.ts:4122
Immutable network entity identifier.
Inherited from
Section titled “Inherited from”position
Section titled “position”position:
Vector3
Defined in: server/api.d.ts:4132
Authoritative world-space position; assignment forces replicated state.
Inherited from
Section titled “Inherited from”radius
Section titled “radius”
readonlyradius:number
Defined in: server/api.d.ts:2321
Sphere radius in world units; meaningless for a box.
rotation
Section titled “rotation”rotation:
Vector3|Quaternion
Defined in: server/api.d.ts:4137
Authoritative rotation; reads return a quaternion and assignments accept a quaternion or Euler angles in degrees.
Inherited from
Section titled “Inherited from”
readonlyshape:string
Defined in: server/api.d.ts:2311
Primitive this volume was created as: “sphere” or “box”. Empty once destroyed.
readonlysize:Vector3
Defined in: server/api.d.ts:2326
Box full extents; meaningless for a sphere.
readonlystate:StateBag
Defined in: server/api.d.ts:4142
Arbitrary key/value state carried by this entity. The server writes it and every client that can see the entity receives it; see StateBag.
Inherited from
Section titled “Inherited from”virtualWorld
Section titled “virtualWorld”
readonlyvirtualWorld:number
Defined in: server/api.d.ts:4127
Current virtual-world identifier.
