navcat docs
    Preparing search index...

    Function findPath

    • Find a path between two positions on a NavMesh.

      If the end node cannot be reached through the navigation graph, the last node in the path will be the nearest the end node.

      Internally:

      • finds the closest poly for the start and end positions with

      Parameters

      • navMesh: NavMesh

        The navigation mesh.

      • start: Vec3

        The starting position in world space.

      • end: Vec3

        The ending position in world space.

      • halfExtents: Vec3
      • queryFilter: QueryFilter

        The query filter.

      Returns FindPathResult

      The result of the pathfinding operation.

      • findNearestPoly
      • finds a nav mesh node path with
      • findNodePath
      • finds a straight path with
      • findStraightPath

      If you want more fine tuned behaviour you can call these methods directly. For example, for agent movement you might want to find a node path once but regularly re-call

      • findStraightPath