> For the complete documentation index, see [llms.txt](https://gley.gitbook.io/mobile-traffic-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-traffic-system/complete-api/setactivesquares.md).

# SetActiveSquares

### Description

Set how far away from the player the active intersections should be -> default is 1.&#x20;

If set to 2 -> intersections will update on a 2 square distance from the player.

Read more about active squares and how they work [Initializing Asset](/mobile-traffic-system/setup-guide/initializing-asset.md#active-squares-levels)

### Declaration&#x20;

```csharp
public static void SetActiveSquares(int level)
```

### Parameters

<table><thead><tr><th width="188">Name</th><th>Description</th></tr></thead><tbody><tr><td><strong>level</strong></td><td>How many squares away should intersections be updated.</td></tr></tbody></table>

### Example

```csharp
using Gley.TrafficSystem;
using UnityEngine;

public class Test : MonoBehaviour
{
    //a reference to vehicle pool and player assigned in inspector
    public VehiclePool vehiclePool;
    public Transform player;

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

    public void ChangeLevels()
    {
        API.SetActiveSquares(2);
    }
}

```
