<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/NavigationController/computePath(to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation20NavigationControllerV11computePath2toSayAA0C12MeshResourceC0F4NodeVGSgs5SIMD3VySfG_tYaF"
  },
  "title" : "computePath(to:)"
}
-->

# computePath(to:)

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(to targetPosition: SIMD3<Float>) async -> [NavigationMeshResource.PathNode]?
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)