Documentation Index
Fetch the complete documentation index at: https://mintlify.com/BunnyNabbit/celaria-formats/llms.txt
Use this file to discover all available pages before exploring further.
Barrier is an invisible physics surface that slows down players who move through it. It extends Instance and can act as either a vertical wall or a horizontal floor depending on how its scale is configured. The instanceId is not fixed — it returns 3 for walls and 4 for floors — making scale a required constraint rather than an aesthetic choice.
Barriers require
CelariaMap format version 2 or higher for serialization. Maps saved in an earlier format version cannot include barriers.Constructor
position to [0, 0, 0], rotation to 0, and scale to [1, 0, 1] (a wall by default).
Properties
World-space position of the barrier, inherited from
Instance. Defaults to [0, 0, 0]. Z is the gravity axis.The dimensions of the barrier surface. One axis component must be
Setting both
0 to identify whether the barrier is a wall or a floor. Defaults to [1, 0, 1] (a wall).scale must conform to one of these two shapes:| Shape | Type | Condition | Role |
|---|---|---|---|
[x, y, 0] | XYRestrainedVector3 | scale[2] === 0 | Floor — spans the XY plane |
[x, 0, z] | XZRestrainedVector3 | scale[1] === 0 | Wall — spans the XZ plane |
scale[1] and scale[2] to non-zero values, or setting scale[0] to 0, produces an indeterminate state that throws an error when instanceId is accessed.Rotation of the barrier surface around the Z axis, in radians. Defaults to
0.Getters
Returns
3 if the barrier is acting as a wall (scale[0] and scale[2] are both non-zero, with scale[1] equal to 0).Returns 4 if the barrier is acting as a floor (scale[0] and scale[1] are both non-zero, with scale[2] equal to 0).Wall vs floor
The role of aBarrier is determined entirely by its scale:
- Wall (
instanceId: 3): Setscale[1]to0. The barrier spans the XZ plane — it stands vertically like a wall. - Floor (
instanceId: 4): Setscale[2]to0. The barrier spans the XY plane — it lies flat like a floor.
Examples
Creating a wall barrier
Creating a floor barrier
Guarding against invalid scale
Related
Instance
Abstract base class that Barrier extends.
Map objects guide
Overview of all map object types and how to use them.
CelariaMap
Serialization class that requires version 2 for barriers.
Types reference
FlatVector3 and other type definitions.