> For the complete documentation index, see [llms.txt](https://gley.gitbook.io/mobile-pedestrian-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-pedestrian-system/complete-api/triggercolliderremovedevent.md).

# TriggerColliderRemovedEvent

### Description

If a pedestrian detects a collider and another script destroys that collider, the OnTriggerExit method is not automatically triggered. In such cases, this method needs to be manually invoked to remove the obstacle from the pedestrian obstacles list.

### Declaration

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

public static void TriggerColliderRemovedEvent(Collider[] collider)
```

### Parameters

<table><thead><tr><th width="261">Name</th><th>Description</th></tr></thead><tbody><tr><td>collider</td><td>The removed collider.</td></tr><tr><td>colliders</td><td>The removed colliders.</td></tr></tbody></table>

### Example

```csharp
using Gley.PedestrianSystem;
using UnityEngine;


public class Test : MonoBehaviour
{
    // A reference to the pedestrian pool and player assigned in the inspector.
    public PedestrianPool PedestrianPool;
    public Transform Player;

    void Start()
    {
        API.Initialize(Player, 1, PedestrianPool);
    }

    public void DestroyObstacle()
    {
        GameObject obstacleToDestroy = GameObject.Find("SomeObstacle");
        Collider collider = obstacleToDestroy.GetComponent<Collider>();
        API.TriggerColliderRemovedEvent(collider);
        Destroy(obstacleToDestroy);
    }


    // Used for demonstration purposes.
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            DestroyObstacle();
        }
    }
}
```
