Skip to main content

Layer-based Collision Detection Settings

Layer Collision Matrix

Layer-based collision detection controls which GameObjects can physically interact with which other GameObjects, based on the Unity layer each object belongs to. You configure this in the Layer Collision Matrix, found in Edit > Project Settings > Physics.

In this simulator, the matrix determines interactions such as:

  • Which actor types trigger a stop line's collider
  • Which objects the TrafficObj_GridWall blocks
  • What each actor's sensors can detect

Misconfigured layer interactions are a common cause of agents not stopping, sensors failing to fire, or boundary walls not working as expected. When adding a new actor or traffic object, always verify its layer assignments against the matrix.

For a full explanation of how to read and edit the matrix, see the official Unity documentation for this project's engine version:

Layer-based collision detection — Unity Manual (2022.3)