> 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/setup-guide/pedestrian-pool.md).

# Pedestrian Pool

Each scene requires a Pedestrian Pool to function correctly.&#x20;

A Pedestrian Pool is a collection of all pedestrian prefabs available in the current scene. It ensures that the system has access to the necessary pedestrian models for instantiation and proper operation within the scene.

## Create a Pedestrian Pool

Right-click on the Project Window -> Create -> Pedestrian System -> Pedestrian Pool

<figure><img src="https://449878595-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCzYS154gIDHX1Uf5YcUv%2Fuploads%2FIhSShS2LRjsiwSrLPFgX%2FCreatePedestrianPool.jpg?alt=media&amp;token=776917dc-6da9-4b9b-8526-1bc91ecd951d" alt=""><figcaption></figcaption></figure>

This will create a scriptable object inside the project folder.

## Add pedestrians to the pool

There is no limit for the pool pedestrians.

Each entry represents a type of pedestrian that will be available inside the system. Each pedestrian needs to be configured according to the [Pedestrian Implementation](/mobile-pedestrian-system/setup-guide/pedestrian-implementation.md).

<figure><img src="https://449878595-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCzYS154gIDHX1Uf5YcUv%2Fuploads%2FTvLRpcbvLIvJiOq5p49m%2Fimage_2024-07-29_153117330.png?alt=media&amp;token=366fad35-6482-43f5-8194-2c14bf54656b" alt=""><figcaption></figcaption></figure>

When adding a pedestrian type to the pool, the system ensures that at least one pedestrian of each type will be instantiated, provided that the maximum number of pedestrians is greater than or equal to the total number of pedestrian types. For example, if there are 5 types of pedestrians, the maximum number of pedestrians should be at least 5.

The **percentage** value for each pedestrian type represents its proportional allocation out of the total instantiated pedestrians. This functions more like a comparative slider than a true percentage.

In the example given, if the maximum number of pedestrians is 20, the initial allocation based on the percentages (10%, 20%, 20%, 5%, and 1%) would total 56%. This means that the system needs to recalibrate the percentages after ensuring that one pedestrian of each type is instantiated.

Recalculated, the percentages might look like this: 9%, 19%, 19%, 4%, and 0%. This leaves room for 15 additional pedestrians to be instantiated. Each 'percentage' now effectively translates to approximately 3.4% per additional pedestrian.

Thus, the system would instantiate:

* 2 Male1 (9/3.4 ≈ 2)
* 5 Male2 (19/3.4 ≈ 5)
* 5 Female2 (19/3.4 ≈ 5)
* 1 Male3 (4/3.4 ≈ 1)
* Plus 2 additional pedestrians, likely the most common types, based on rounding.

The **Don't Instantiate** checkbox prevents a specific type of pedestrian from being used by the system. These pedestrians remain disabled until explicitly activated by the developer. This feature is useful for scenarios where certain types of pedestrians are required only in specific areas, such as construction workers appearing only when the player is near a construction site.

<figure><img src="https://449878595-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCzYS154gIDHX1Uf5YcUv%2Fuploads%2FYLosPyDtvKHSWDyomTPX%2Fimage_2024-07-29_154704836.png?alt=media&amp;token=96933d44-4ab0-4701-af9c-2ce564d40895" alt=""><figcaption></figcaption></figure>

Male3 is marked as **DontInstantiate** so it is disabled and notice the distribution of all other pedestrian types inside the scene.

Activating these pedestrians requires coding skills as they can only be enabled using API.&#x20;

Check the [GetExcludedPedestrianList](/mobile-pedestrian-system/complete-api/getexcludedpedestrianlist.md)for a complete scripting example.
