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

# AddExcludedPedestrianToSystem

### Description

Excluded pedestrians are a special kind of pedestrians marked as **Don't Instantiate** inside the Pedestrian Pool. Those pedestrians will not be instantiated by the system unless the user specifies it to be instantiated. Read more about them [Pedestrian Pool](/mobile-pedestrian-system/setup-guide/pedestrian-pool.md)

The AddExcludedVehicleToSystem adds a previously excluded pedestrian back to the Pedestrian System and the pedestrian behaves normally.

### Declaration

```csharp
public static void AddExcludedPedestrianToSystem(int pedestrianIndex)
```

### Parameters

<table><thead><tr><th width="261">Name</th><th>Description</th></tr></thead><tbody><tr><td><strong>pedestrianIndex</strong></td><td>The index of the pedestrian.</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 AddPedestrianToSystem()
    {
        API.AddExcludedPedestrianToSystem(0);
    }

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