Version: 2019.2
LanguageEnglish
  • C#
Experimental: this API is experimental and might be changed or removed in the future.

NavMeshQuery.EndFindPath

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 Experimental.AI.PathQueryStatus EndFindPath(out int pathSize);

Parameters

pathSizeA reference to an int which will be set to the number of NavMesh nodes in the found path.

Returns

PathQueryStatus Success when the number of nodes in the path was retrieved correctly.
PartialPath when a path was found but it falls short of the desired end location.
Failure when the path size can not be evaluated because the preceding call to UpdateFindPath was not successful.

Description

Obtains the number of nodes in the path that has been computed during a successful NavMeshQuery.UpdateFindPath operation.

This method prepares the path data so that NavMeshQuery.GetPathResult can be used afterward to retrieve the actual array of PolygonId values that make up the path.

Important: This method should only be called once at the end of the pathfinding operation. Calling it multiple times may ruin the stored path.

See Also: PathQueryStatus.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961