navcat docs
    Preparing search index...

    Function findSmoothPath

    • Find a smooth path between two positions on a NavMesh.

      This method computes a smooth path by iteratively moving along the navigation mesh surface using the polygon path found between start and end positions. The resulting path follows the surface more naturally than a straight path.

      If the end node cannot be reached through the navigation graph, the path will go as far as possible toward the target.

      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

        The half extents for nearest polygon queries.

      • queryFilter: QueryFilter

        The query filter.

      • stepSize: number

        The step size for movement along the surface

      • slop: number

        The distance tolerance for reaching waypoints

      • maxPoints: number

      Returns FindSmoothPathResult

      The result of the smooth pathfinding operation, with path points containing position, type, and nodeRef information.

      • findNearestPoly
      • finds a nav mesh node path with
      • findNodePath
      • computes a smooth path by iteratively moving along the surface with
      • moveAlongSurface