# AITrafficController

## Traffic Prefabs

|                |                                         |
| -------------- | --------------------------------------- |
| trafficPrefabs | Array of AITrafficCar prefabs to spawn. |

## Car Settings

| Variables               |                                                                                                                                                     |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| useYieldtriggers        | Enables the processing of YieldTrigger logic.                                                                                                       |
| speedMultiplier         | Multiplier used for calculating speed; 2.23693629 by default for MPH.                                                                               |
| steerSensitivity        | Multiplier used to control how quickly the car's front wheels turn toward the target direction.                                                     |
| maxSteerAngle           | Maximum angle the car's front wheels are allowed to turn toward the target direction.                                                               |
| stopThreshold           | Front detection sensor distance at which a car will start braking.                                                                                  |
| layerMask               | Physics layers the detection sensors can detect.                                                                                                    |
| enableLaneChanging      | Enables the processing of Lane Changing logic.                                                                                                      |
| changeLaneTrigger       | Minimum amount of time until a car is allowed to change lanes once conditions are met.                                                              |
| minSpeedToChgangeLanes  | Minimum speed required to change lanes.                                                                                                             |
| changeLaneCooldown      | Minimum time required after changing lanes before allowed to change lanes again.                                                                    |
| unassignedBrakeMaterial | Dummy material used for brake light emission logic when a car does not have an assigned brake variable.                                             |
| setCarParent            | AI Cars will be parented to the 'Car Parent' transform, this AITrafficController will be the parent if a parent is not assigned.                    |
| carParent               | If 'Set Car Parent' is enabled, AI Cars will be parented to this transform, this AITrafficController will be the parent if a parent is not defined. |

## Pooling

| Variables     |                                                                                                                                  |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| usePooling    | Enables the processing of Pooling logic.                                                                                         |
| centerPoint   | Transform that pooling distances will be checked against.                                                                        |
| useRouteLimit | When using pooling, cars will not spawn to a route if the route limit is met.                                                    |
| density       | Max amount of cars the pooling system is allowed to spawn.                                                                       |
| spawnRate     | Frequency at which pooling spawn is performed.                                                                                   |
| minSpawnZone  | Cars can't spawn or despawn in this zone.                                                                                        |
| cullHeadLight | Car headlights will be disabled outside of this zone.                                                                            |
| activeZone    | Cars only spawn if the spawn point is not visible by the camera.                                                                 |
| spawnZone     | Cars can spawn anywhere in this zone, even if spawn point is visible by the camera. Cars outside of this zone will be despawned. |

| Public Methods |   |
| -------------- | - |
|                |   |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://simpletrafficsystem.turnthegameon.com/documentation/api/aitrafficcontroller.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
