Asynchronously requests a pathfind from the owning entity's position to the target position and waits for the path or a failure.
If the function returns an empty path, the pathfind succeeded with no nodes (for example, the start and end positions are in the same place).
If the function returns nil, the pathfinding failed to find a path.
func computePath(from startPosition: SIMD3<Float>, to targetPosition: SIMD3<Float>) async -> [NavigationMeshResource.PathNode]?
Asynchronously requests a pathfind from a given position to the target position and waits for the path or a failure.
If the function returns an empty path, the pathfind succeeded with no nodes (for example, the start and end positions are in the same place).
If the function returns nil, the pathfinding failed to find a path.
get · iOS 27.0+
currentPath
TypeScript
get currentPath(): Array<NavigationMeshResource_PathNode>
Swift declaration
var currentPath: [NavigationMeshResource.PathNode] { get }
The computed path to the target position found by requestPath(). If called before the pathfind completes,
a partial path will be returned. This partial path may be suboptimal.
If the pathfind failed or was not requested, the function will return an empty array.
method · iOS 27.0+
requestPath
TypeScript
requestPathTo(targetPosition: SDKHandle): void
Swift declaration
func requestPath(to targetPosition: SIMD3<Float>)
Requests a pathfind from the owning entity's position to the target position.