Legacy Documentation: Version 5.6 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

NavMeshBuilder.UpdateNavMeshDataAsync

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static function UpdateNavMeshDataAsync(data: AI.NavMeshData, buildSettings: AI.NavMeshBuildSettings, sources: List<NavMeshBuildSource>, localBounds: Bounds): AsyncOperation;
public static AsyncOperation UpdateNavMeshDataAsync(AI.NavMeshData data, AI.NavMeshBuildSettings buildSettings, List<NavMeshBuildSource> sources, Bounds localBounds);

Parameters

data The NavMeshData to update.
buildSettings The build settings which is used to update the NavMeshData. The build settings is also hashed along with the data, so changing settings will likely to cause full rebuild.
sources List of input geometry used for baking, they describe the surfaces to walk on or obstacles to avoid.
localBounds Bounding box relative to position and rotation which describes to volume where the NavMesh should be built. Empty bounds is treated as no-bounds, that is, the NavMesh will cover all the inputs.

Returns

AsyncOperation Can be used to check the progress of the update.

Description

Asynchronously and incrementally updates the NavMeshData based on the sources.

Each time NavMeshData is built or updated, the source data is hashed, and the hashes are stored along with the NavMeshData.

When UpdateNavMeshDataAsync() is called, first the hashes are compared and only changed portions are rebuilt. For this reason, the list of sources should always contain all the input geometry, even if they haven't moved or changed. If the list of sources is modified between calls to UpdateNavMeshDataAsync the missing/added sources are considered changes.

See Also: NavMeshBuilder.Cancel.