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

# SetCameras

### Description

Update active cameras that are used to remove pedestrians when they are not in view. This is used in multiplayer/split-screen setups.

### Declaration

```csharp
public static void SetCameras(Transform[] activeCameras)
```

### Parameters

<table><thead><tr><th width="261">Name</th><th>Description</th></tr></thead><tbody><tr><td><strong>activeCameras</strong></td><td>All cameras that follow the players or the players themself. 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 cameras.
    public Transform[] someCameras;

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

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