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

# GetWaypointList

### Description

Get the waypoint indexes that are included in the pedestrian path.

### Declaration

```csharp
public static List<int> GetWaypointList(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>

### Returns

**List\<int> -** A list of waypoint indexes.

### Example

```csharp
using Gley.PedestrianSystem;
using System.Collections.Generic;
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 GetWaypoints()
    {
        List<int> pathWaypoints = API.GetWaypointList(0);
        foreach (int waypoint in pathWaypoints)
        {
            Debug.Log($"Waypoint index: {waypoint}");
        }
    }

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