> 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/triggercolliderremovedevent.md).

# TriggerColliderRemovedEvent

### Description

If a vehicle detects a collider and that collider is destroyed by another script, the OnTriggerExit method is not automatically triggered. In such cases, this method needs to be manually invoked to remove the obstacle in front of the traffic vehicle.

### Declaration&#x20;

```csharp
public static void TriggerColliderRemovedEvent(Collider collider)
```

### Parameters

<table><thead><tr><th width="220">Name</th><th>Description</th></tr></thead><tbody><tr><td><strong>collider</strong></td><td>The removed collider.</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 DestroyObstacle()
    {
        GameObject obstacleToDestroy = GameObject.Find("SomeObstacle");
        Collider collider = obstacleToDestroy.GetComponent<Collider>();
        API.TriggerColliderRemovedEvent(collider);
        Destroy(obstacleToDestroy);
    }
}

```
