ColliderConfig
Defined in: physics/src/types.ts:169
Configuration for creating a collider.
Properties
Section titled “Properties”contactSkin?
Section titled “contactSkin?”
optionalcontactSkin?: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.
density?
Section titled “density?”
optionaldensity?:number
Defined in: physics/src/types.ts:184
Density (affects mass for dynamic bodies).
friction?
Section titled “friction?”
optionalfriction?:number
Defined in: physics/src/types.ts:182
Friction coefficient.
layers?
Section titled “layers?”
optionallayers?:number
Defined in: physics/src/types.ts:196
Collision layer membership bitmask.
optionalmask?:number
Defined in: physics/src/types.ts:198
Collision filter mask (which layers to interact with).
offset?
Section titled “offset?”
optionaloffset?:object
Defined in: physics/src/types.ts:173
Offset from body center in pixels.
x:
number
y:
number
oneWay?
Section titled “oneWay?”
optionaloneWay?: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.
restitution?
Section titled “restitution?”
optionalrestitution?:number
Defined in: physics/src/types.ts:180
Coefficient of restitution (bounciness).
rotation?
Section titled “rotation?”
optionalrotation?: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.
sensor?
Section titled “sensor?”
optionalsensor?: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.