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

# SetCamera

### Description

Update the active camera that is used to remove pedestrians when they are not in view.

### Declaration

```csharp
public static void SetCamera(Transform activeCamera)
```

### Parameters

<table><thead><tr><th width="261">Name</th><th>Description</th></tr></thead><tbody><tr><td><strong>activeCamera</strong></td><td>Camera that follows the player or the player itself. Used to determine the line of sight for pedestrian instantiations.</td></tr></tbody></table>

### Example

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

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

    // A reference to some camera.
    public Transform someCamera;

    void Start()
    {
        API.Initialize(player, 20, pedestrianPool);
    }

    // Called at the right time by your script
    public void UpdateCamera()
    {
        API.SetCamera(someCamera);
    }
}
```
