Skip to content

Colliders

Each physics entity needs at least one collider shape alongside its RigidBody. The collider defines the physical shape used for collision detection.

Collider Types

ColliderShapeUse Case
BoxColliderAxis-aligned rectangleCrates, platforms, walls
CircleColliderCircleBalls, coins, rounded objects
CapsuleColliderCapsule (rectangle with rounded ends)Characters, pills
SegmentColliderLine segmentThin walls, one-way platforms
PolygonColliderConvex polygon (up to 8 vertices)Custom convex shapes
ChainColliderChain of line segmentsTerrain, complex static boundaries

Common Properties

All colliders (except ChainCollider) share these properties:

PropertyTypeDefaultDescription
densitynumber1.0Mass density. Affects total body mass
frictionnumber0.6Surface friction (0 = ice, 1 = rubber)
restitutionnumber0.0Bounciness (0 = no bounce, 1 = full bounce)
isSensorbooleanfalseTrigger zone — detects overlap without physical response
categoryBitsnumber1Collision filter category bits
enabledbooleantrueEnable/disable the collider

BoxCollider

An axis-aligned rectangular collider.

PropertyTypeDefaultDescription
halfExtentsVec2{x: 0.5, y: 0.5}Half-width and half-height in physics units
offsetVec2{x: 0, y: 0}Offset from entity center in physics units
radiusnumber0.0Corner rounding radius. Creates a rounded rectangle when > 0

Plus all common properties.

CircleCollider

A circular collider.

PropertyTypeDefaultDescription
radiusnumber0.5Circle radius in physics units
offsetVec2{x: 0, y: 0}Offset from entity center in physics units

Plus all common properties.

CapsuleCollider

A capsule shape (rectangle with semicircle caps on top and bottom).

PropertyTypeDefaultDescription
radiusnumber0.5Capsule radius in physics units
halfHeightnumber0.5Half-height of the rectangular center section in physics units
offsetVec2{x: 0, y: 0}Offset from entity center in physics units

Plus all common properties.

Collision Filtering

Collision layers let you control which objects can collide with each other. The system uses 16 named layers with bitmask filtering.

How It Works

Each collider has a categoryBits field that assigns it to a layer. The collision matrix in Settings → Physics → Collision Matrix determines which layers interact.

PropertyTypeDefaultDescription
categoryBitsnumber1Layer this collider belongs to (bitmask, one bit per layer)

Collision occurs when both colliders’ layers are allowed to interact in the collision matrix.

Editor Setup

  1. Name your layers in Settings → Physics → Collision Layers (up to 16 layers, e.g., “Player”, “Enemy”, “Ground”, “Projectile”)
  2. Configure the matrix in Settings → Physics → Collision Matrix — check which layer pairs should collide
  3. Assign layers in the Inspector — each collider’s categoryBits dropdown shows the named layers

See Also