> For the complete documentation index, see [llms.txt](https://gley.gitbook.io/mobile-traffic-system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gley.gitbook.io/mobile-traffic-system/complete-api/trafficoptions.md).

# TrafficOptions

### Description

A properties class used to initialize the Traffic System

### Declaration&#x20;

```csharp
 public class TrafficOptions
```

### Members

<table><thead><tr><th width="220">Name</th><th>Description</th></tr></thead><tbody><tr><td><strong>minDistanceToAdd</strong></td><td>Beyond the MinDistanceToAdd, vehicles will spawn even without any obstructions or buildings blocking the view. </td></tr><tr><td><strong>distanceToRemove</strong></td><td>This value represents the approximate distance from the player at which a vehicle is flagged to be removed from the scene.</td></tr><tr><td><strong>masterVolume</strong></td><td>Represents the proximity from the player within which the adjacent cells will be active.</td></tr><tr><td><strong>useWaypointPriority</strong></td><td>Enables the usage of priority waypoints.</td></tr><tr><td><strong>greenLightTime</strong></td><td>The master intersection green time, if set, will override the individual times set on each intersection.</td></tr><tr><td><strong>yellowLightTime</strong></td><td>The master intersection yellow time, if set, will override the individual times set on each intersection.</td></tr><tr><td><strong>activeSquaresLevel</strong></td><td>Represents the proximity from the player within which the adjacent cells will be active.</td></tr><tr><td><strong>initialDensity</strong></td><td>The number of vehicles that will be active from the start. Should be &#x3C;= than maxNrOfVehicles.</td></tr><tr><td><strong>lightsOn</strong></td><td>If true, the vehicles will be instantiated with lights on by default.</td></tr><tr><td><strong>disableWaypointsArea</strong></td><td>Mark the waypoints in that area as disabled from the start. No vehicles will spawn there.</td></tr></tbody></table>

For more in-depth details of each member consult the [Initializing Asset](/mobile-traffic-system/setup-guide/initializing-asset.md)section.

### Example

Assign all the properties inside the inspector, create a TrafficOptions object, and add it to the Initialize method.&#x20;

If an option is not set, the default value will be used. Only set the properties you want to change.

```csharp
public Transform player;
public int nrOfVehicles = 1;
public VehiclePool vehiclePool;
public int activeSquareLevels = 1;
public float minDistanceToAdd = -1;
public float distanceToRemove = -1;
public float yellowLightTime = -1;
public float greenLightTime = -1;
public int initialActiveVehicles = -1;
public bool useWaypointPriority = false;
public bool lightsOn = false;
public Area disableWaypointsArea = default;

void Start()
{
    TrafficOptions options = new TrafficOptions()
    {
        activeSquaresLevel = activeSquareLevels,
        disableWaypointsArea = disableWaypointsArea,
        distanceToRemove = distanceToRemove,
        greenLightTime = greenLightTime,
        initialDensity = initialActiveVehicles,
        lightsOn = lightsOn,
        minDistanceToAdd = minDistanceToAdd,
        useWaypointPriority = useWaypointPriority,
        yellowLightTime = yellowLightTime,
    };

   
    API.Initialize(player, nrOfVehicles, vehiclePool, options);
}
```
