# junction

> Talos next · Since next

Where roads meet: the road surface between their mouths, with rounded corners, stop lines and the lanes through it (`ctx.world.junction`).

Built at load as `<id>-surface`, a mesh and trimesh collider 5 mm under the roads, so a road that carries on through it is drawn over it.

Use it in a scene entity's `components` list as `{ "type": "junction", … }`. The contract writes the fields flat and refuses unknown keys.

## Fields

| Field | Type | Required | Default | Allowed values | Description |
|---|---|---|---|---|---|
| `arms` | `JunctionArm[]` | yes |  |  | The roads that meet here: two arms or more in all (a through road counts twice). |
| `cornerRadiusM` | `number` | no | `6` |  | Radius of each corner where two arms meet, metres, 0 or more. Default 6. |
| `stopLines` | `boolean` | no | `true` |  | A stop line across each arm's lane in. Default true. |
| `keepLeft` | `boolean` | no | `false` |  | Traffic keeps left (the lanes and stop lines swap sides). Default false. |
| `material` | `PhysicsMaterial` | no |  |  | Physics material of the junction's surface (its grip, its `surface` kind). Default: the engine's default. |

## Rules that can refuse it

- `junction-invalid`
- `selftest-bad-scenario`
