# preserveTilesOutsideBounds

> Specifies whether to keep the NavMesh unchanged in the sections outside the build bounds during a NavMesh update.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine.AI](/engine/6000.3/script-reference/unityengine/ai.md)
* **Assembly:** UnityEngine.AIModule

```csharp
public bool preserveTilesOutsideBounds { get; set; }
```

### Remarks

With this property enabled, a NavMesh update recomputes only the NavMesh tiles that fall completely inside the specified local bounds. All other tiles, such as those fully outside the bounds or those that only partially intersect them, remain unchanged. Unity rebuilds the recomputed tiles as usual from the provided [NavMeshBuildSource](/engine/6000.3/script-reference/unityengine/ai/navmeshbuildsource.md) objects.

The default value is false, which means all tiles are rebuilt during a NavMesh update regardless of whether they fall inside the bounds.

This property is useful when you need to update the NavMesh in a limited volume at runtime without affecting the rest of the NavMesh. Use this property to clear tiles in a specific area. Unity removes any tile inside the bounds that has no overlapping sources.

The spatial dimensions of a NavMesh tile equal [NavMeshBuildSettings.tileSize](/engine/6000.3/script-reference/unityengine/ai/navmeshbuildsettings/tilesize.md) multiplied by [NavMeshBuildSettings.voxelSize](/engine/6000.3/script-reference/unityengine/ai/navmeshbuildsettings/voxelsize.md). The world position of the tile grid origin depends on the positions and rotations used to build and then to instantiate the [NavMeshData](/engine/6000.3/script-reference/unityengine/ai/navmeshdata.md). The bounds passed to UpdateNavMeshData or UpdateNavMeshDataAsync are in local space relative to that origin.

When this property is true, a NavMesh update has the following additional effects:

* Unity doesn't create the height mesh, and if one already exists, Unity removes it.
* Unity removes all automatically generated off-mesh links and doesn't regenerate them. This is because generated links cannot be modified for only one section of the NavMesh. Manually placed [NavMeshLink](https://docs.unity3d.com/Packages/com.unity.ai.navigation@2.0/api/Unity.AI.Navigation.NavMeshLink.html) components are unaffected.
* The NavMesh builder carries over most build settings from the existing [NavMeshData](/engine/6000.3/script-reference/unityengine/ai/navmeshdata.md) in order to preserve consistency. The exceptions are [NavMeshBuildSettings.minRegionArea](/engine/6000.3/script-reference/unityengine/ai/navmeshbuildsettings/minregionarea.md), [NavMeshBuildSettings.maxJobWorkers](/engine/6000.3/script-reference/unityengine/ai/navmeshbuildsettings/maxjobworkers.md), [NavMeshBuildSettings.debug](/engine/6000.3/script-reference/unityengine/ai/navmeshbuildsettings/debug.md), and [NavMeshBuildSettings.buildHeightMesh](/engine/6000.3/script-reference/unityengine/ai/navmeshbuildsettings/buildheightmesh.md), which are taken from the settings you provide. Unity ignores changes to other settings such as [NavMeshBuildSettings.agentTypeID](/engine/6000.3/script-reference/unityengine/ai/navmeshbuildsettings/agenttypeid.md) or [NavMeshBuildSettings.agentHeight](/engine/6000.3/script-reference/unityengine/ai/navmeshbuildsettings/agentheight.md). The values already stored in the [NavMeshData](/engine/6000.3/script-reference/unityengine/ai/navmeshdata.md) are used instead.

Known issue: If you call UpdateNavMeshDataAsync a second time for the same [NavMeshData](/engine/6000.3/script-reference/unityengine/ai/navmeshdata.md) object, the first operation is canceled. Therefore, you can't start operations with `preserveTilesOutsideBounds` in parallel to affect different parts of the NavMesh. Each call must wait for the previous operation's [AsyncOperation.isDone](/engine/6000.3/script-reference/unityengine/asyncoperation/isdone.md) to be true before starting.

This property is available as of Unity 2020.1.
