# AddExcludedVehicleToSystem

### Description

Excluded vehicles are a special kind of vehicle marked as **Don't Instantiate** inside the Vehicle Pool. These vehicles will not be instantiated by the system unless the user specifies to be instantiated using this method. Read more about them [#add-vehicles-to-the-pool](https://gley.gitbook.io/mobile-traffic-system/setup-guide/vehicle-pool#add-vehicles-to-the-pool "mention")

The AddExcludedVehicleToSystem adds a previously excluded vehicle back to the Traffic System and the vehicle behaves normally.

### Declaration&#x20;

```csharp
public static void AddExcludedVehicleToSystem(int vehicleIndex)
```

### Parameters

<table><thead><tr><th width="188">Name</th><th>Description</th></tr></thead><tbody><tr><td><strong>vehicleIndex</strong></td><td>Index of the vehicle to be added back to the system</td></tr></tbody></table>

### Example

```csharp
using Gley.TrafficSystem;
using UnityEngine;

public class Test : MonoBehaviour
{
    //a reference to vehicle pool and player assigned in inspector
    public VehiclePool vehiclePool;
    public Transform player;

    void Start()
    {
        API.Initialize(player, 20, vehiclePool);
    }

    public void AddVehicle()
    {
        //0 - is an example index of the vehicle
        API.AddExcludedVehicleToSystem(0);
    }
}

```
