Skip to content

ColliderConfig

Defined in: physics/src/types.ts:169

Configuration for creating a collider.

optional contactSkin?: number

Defined in: physics/src/types.ts:192

Keeps this collider this many pixels away from anything it touches, so a resting body sits that far above the surface. Two colliders that both set a skin are held apart by the sum of the two.

Contacts only — shape casts and overlap queries ignore it.


optional density?: number

Defined in: physics/src/types.ts:184

Density (affects mass for dynamic bodies).


optional friction?: number

Defined in: physics/src/types.ts:182

Friction coefficient.


optional layers?: number

Defined in: physics/src/types.ts:196

Collision layer membership bitmask.


optional mask?: number

Defined in: physics/src/types.ts:198

Collision filter mask (which layers to interact with).


optional offset?: object

Defined in: physics/src/types.ts:173

Offset from body center in pixels.

x: number

y: number


optional oneWay?: OneWayConfig

Defined in: physics/src/types.ts:204

Make this collider a one-way platform: solid for bodies arriving from the side direction faces, passable from every other side. Installs a built-in contact filter on the collider.


optional restitution?: number

Defined in: physics/src/types.ts:180

Coefficient of restitution (bounciness).


optional rotation?: number

Defined in: physics/src/types.ts:178

Rotation relative to the body in radians, about the collider’s offset point. For axis: "x" capsules it adds on top of the 90° axis rotation.


optional sensor?: boolean

Defined in: physics/src/types.ts:194

If true, this is a sensor (triggers events but no physical response).


shape: ColliderShape

Defined in: physics/src/types.ts:171

Shape of the collider.