Skip to content

Commit

Permalink
fixed NavMesh for one sample
Browse files Browse the repository at this point in the history
  • Loading branch information
David624634 committed Apr 15, 2024
1 parent 08dae78 commit 7b383bd
Show file tree
Hide file tree
Showing 4 changed files with 266 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ public override TaskState EvaluateTaskState()
{
if (navMeshAgent.pathStatus == NavMeshPathStatus.PathPartial)
{
Debug.LogWarning("Path calculation to " + Destination.ToString() + " failed because only a partial path could be generated. Use an DestinationObject instead of Destination coordinates and activate follow to allow partial paths.");
Vector3[] corners = navMeshAgent.path.corners;
string lastCorner = corners[corners.Length - 1].ToString();

Debug.LogWarning("Path calculation to " + Destination.ToString() + " failed because only a partial path could be generated. Use an DestinationObject instead of Destination coordinates and activate follow to allow partial paths. " +
"The clostes point was: " + lastCorner);
return TaskState.Failure; // The navmesh agent couldn't generate a complete and valid path
}
}
Expand Down
Loading

0 comments on commit 7b383bd

Please sign in to comment.