navcat docs
    Preparing search index...

    Function raycast

    • Casts a 'walkability' ray along the surface of the navigation mesh from the start position toward the end position.

      This method is meant to be used for quick, short distance checks. The raycast ignores the y-value of the end position (2D check).

      Parameters

      • navMesh: NavMesh

        The navigation mesh to use for the raycast.

      • startNodeRef: number

        The NodeRef for the start polygon

      • startPosition: Vec3

        The starting position in world space.

      • endPosition: Vec3

        The ending position in world space.

      • filter: QueryFilter

        The query filter to apply.

      Returns RaycastResult

      The raycast result with hit information and visited polygons (without cost calculation).