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

# IsPedestrianAtThisWaypoint

### Description

Verifies if a pedestrian has as a target a specific waypoint.

### Declaration

```csharp
public static bool IsPedestrianAtThisWaypoint(int pedestrianIndex, int waypointIndex)
```

### 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><tr><td><strong>waypointIndex</strong></td><td>The index of the waypoint.</td></tr></tbody></table>

### Returns

**bool -** true - if the current target waypoint is equal to the waypoint index.

### 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 CheckWaypoint()
    {
        if (API.IsPedestrianAtThisWaypoint(0, 77))
        {
            Debug.Log("Pedestrian is at waypoint 77");
        }
        else
        {
            Debug.Log("Pedestrian is not at waypoint 77");
        }
    }

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