(4.3.91) Failed to find next corners in the path

Hello Aron, hello everybody :slight_smile:

I am getting this error when I try to use the FleePath algorithm - not with every search- it seems to work for most of the time… but then again, it spams the console with this:

Failed to find next corners in the path
UnityEngine.Debug:LogError (object)
Pathfinding.RichFunnel:Update (UnityEngine.Vector3,System.Collections.Generic.List`1<UnityEngine.Vector3>,int,bool&,bool&) (at ./Library/PackageCache/com.arongranberg.astar@4.3.91/Core/AI/RichPath.cs:399)
Pathfinding.RichAI:UpdateTarget (Pathfinding.RichFunnel) (at ./Library/PackageCache/com.arongranberg.astar@4.3.91/Core/AI/RichAI.cs:388)
Pathfinding.RichAI:OnPathComplete (Pathfinding.Path) (at ./Library/PackageCache/com.arongranberg.astar@4.3.91/Core/AI/RichAI.cs:331)
Pathfinding.AIBase:SetPath (Pathfinding.Path,bool) (at ./Library/PackageCache/com.arongranberg.astar@4.3.91/Core/AI/AIBase.cs:640)
LaserKnights.Units.Ai.MovementAgent:SetFleePath (Pathfinding.Path) (at Assets/Scripts/Units/Ai/Movement/MovementAgent.cs:44)
Pathfinding.Seeker:OnPathComplete (Pathfinding.Path,bool,bool) (at ./Library/PackageCache/com.arongranberg.astar@4.3.91/Core/AI/Seeker.cs:357)
Pathfinding.Seeker:OnPathComplete (Pathfinding.Path) (at ./Library/PackageCache/com.arongranberg.astar@4.3.91/Core/AI/Seeker.cs:316)
Pathfinding.RandomPath:ReturnPath () (at ./Library/PackageCache/com.arongranberg.astar@4.3.91/Pathfinders/RandomPath.cs:142)
Pathfinding.Path:Pathfinding.IPathInternals.ReturnPath () (at ./Library/PackageCache/com.arongranberg.astar@4.3.91/Core/Pathfinding/Path.cs:1068)
Pathfinding.PathReturnQueue:ReturnPaths (bool) (at ./Library/PackageCache/com.arongranberg.astar@4.3.91/Core/Pathfinding/PathReturnQueue.cs:60)
AstarPath:Update () (at ./Library/PackageCache/com.arongranberg.astar@4.3.91/Core/AstarPath.cs:883)

This is how my “Flee method” looks like

public void Flee(Vector3 fleeFrom, float distance, float aimStrength = 1)
{
var theGScoreToStopAt = (int)(distance * 1000f);

        var path = FleePath.Construct(transform.position, fleeFrom, theGScoreToStopAt);
        path.aimStrength = aimStrength;
        path.spread = (int)Mathf.Max(4000, distance);

  	NNConstraint constraint = NNConstraint.Walkable;
  	constraint.distanceMetric = DistanceMetric.ClosestAsSeenFromAboveSoft();
  	constraint.graphMask = seeker.graphMask;
  	path.nnConstraint = constraint;

  	seeker.StartPath(path, SetFleePath);
    }

  private void SetFleePath(Path p)
  {
  	SetPath(p, true);
  }

I tried this on a “huge map”, so that the unit would always find a path… still the error occurs.

Greetings,
Denzi

Any ideas what could cause this? Or how it can be solved? It seems independent of the “size of the navmesh”, e.g. even if the unit has enough space to find a path, this error occurs…

It seems that most of the time, nothing really is broken… the unit that uses the flee algorithm does indeed flee…

But then again, I don’t want my console to be spammed with errors, and of cause I want to get rid of them in a final build :slight_smile:

Hi

Does this happen only with the FleePath, not with any other path type (e.g. ABPath)?

1 Like

Hey Aron :slight_smile:

It is only happening with FleePath… basically the only other way I use pathfinding is like this:

RichAI.destination = destination;
RichAI.SearchPath();

… and here, it doesn’t throw that error.

Fixed with 4.3.100

:+1: :smiley:

1 Like