Hello Aron, hello everybody
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