Recursive AI

Path results

All onepath docs

Every one-call path query reports through the same vocabulary, whatever the world is made of.

PathStatus (namespace RecursiveAI.OnePath)

ValueNumberMeaning
None0No query has produced a result. This is default(PathStatus): an unassigned result, a zeroed array slot or a default struct field never reads as success.
Found1A path to the goal exists in the result.
StartInvalid2Start outside the world, blocked, or no walkable surface near it.
GoalInvalid3Same for the goal.
NoPath4The reachable set was exhausted; grid and graph queries return no best-effort path.
BudgetExhausted5The iteration budget ran out; a sliced query may be continued.
Partial6Goal unreachable (or node limit hit); the path leads to the closest reachable place. Navmesh queries and crowd agents.
InProgress7Not finished; later crowd steps continue it.

The numbers are fixed (hash scenarios and logs write them). HasPath() is true for Found and Partial and false for None.

Zero is never success. Every status enum a result can carry starts with a neutral value at 0 (None, or NotStarted for a search that has not begun), so default means "nothing happened". The success value is 1 in PathStatus (Found), QueryStatus (Success), AreaQueryStatus (Success) and RaycastStatus (Ok).

Result members

MemberGridPath (square, hex)VoxelPathGraphPath (graph, point graph)PathResult (navmesh)
StatusPathStatussamesamesame (Detail holds the QueryStatus)
Found, HasPath, IsPartialyesyesyesyes
Costsearch cost, +∞ without a pathsamesamecorridor cost under the filter
Lengthpolyline length of Points; 0 without a path; NaN when a path exists but the query made no pointssamesame (plain graphs: NaN)straight-path length, 0 without a path
Discrete pathCellsCellsNodesCorridor (polygons)
World-space pathPoints (WorldPoint; the Cell overload of FindPath leaves it empty, Grid.FindPathWithPoints fills it through Grid.Space)Points (VoxelPoint)Points (Point3, point graphs)Points (StraightPathPoint)

GridSearch.Status and GridSearch.Step speak the same vocabulary: None before a search has begun, InProgress while it has work left, then Found or NoPath. The raw engines (AStar, JumpSearch, ThetaSearch, GraphAStar) keep SearchStatus (NotStarted, Running, Found, NotFound).

Agent.SetDestination returns a PathStatus: Found, Partial, InProgress, GoalInvalid (nothing walkable near the destination) or StartInvalid (the agent is not on the mesh).

Positions that are not on the mesh

One rule across the crowd members: a position with no walkable polygon near it is an expected outcome, reported by the member's result, except where the member returns the new agent itself.

MemberOff the mesh
NavMesh.FindPath, NavWorld.FindPathPathStatus.StartInvalid / GoalInvalid in the result
Agent.SetDestinationGoalInvalid (or StartInvalid when the agent itself is off the mesh)
Agent.Teleportreturns false, nothing changes
NavMesh.TrySamplePosition, Raycastfalse / blocked
Crowd.TryAddreturns false, agent is null
Crowd.Addthrows ArgumentException naming position (its behaviour since 1.0.0)

Crowd.Add and Crowd.TryAdd also refuse when the crowd holds CrowdOptions.MaxAgents agents: Add throws InvalidOperationException, TryAdd returns false (compare Count with Options.MaxAgents to tell the two refusals apart). Coordinates that are not finite or beyond ±2^21 and settings out of range are mistakes in the call, not outcomes: both members throw ArgumentOutOfRangeException.

Tier 2 and 3 keep their detail

QueryStatus (namespace RecursiveAI.OnePath.Mesh.Queries) is the polygon-level outcome of NavMeshQuery's sliced and span forms, straight paths and path corridors: None (0), Success (1), Partial (2), InProgress (3), InvalidStartPoly (4), InvalidEndPoly (5), NoStartNearby (6), NoEndNearby (7), InvalidCorridor (8). QueryStatus.ToPathStatus() maps it: None→None, Success→Found, Partial→Partial, InProgress→InProgress, the start errors→StartInvalid, the end errors→GoalInvalid, InvalidCorridor→NoPath. AreaQueryStatus is None (0), Success (1), InProgress (2), InvalidStartPoly (3), InvalidShape (4); RaycastStatus is None (0), Ok (1), InvalidStartPoly (2), StartOutsidePolygon (3). SearchStatus (the raw engines), CorridorStatus and FlowFieldStatus describe their own operations and stay as they are.