FloodPathTracer saying FloodPath is not calculated, stuck in PathState.ReturnQueue?

Just hitting an issue with the FloodPath, haven’t been able to get it working with this code, it always returns an error saying “You must supply a calculated FloodPath to the ‘flood’ argument”

first I construct a flood path, I used a delegate to try to have the FloodPathTracer use it when done,

floodPath = FloodPath.Construct( this.WorldPosition, OnFloodPathDelegate );
AstarPath.StartPath( floodPath );

then within the delegate,

void OnFloodPathDelegate( Path path )
{
	Debug.Log("flood path done?");
	FloodPathTracer floodPathTrace = FloodPathTracer.Construct( GameManager.Instance.player.transform.position, floodPath, OnFloodPathComplete );
	AstarPath.StartPath( floodPathTrace );
}

“Flood path done?” is logged, but right after that is the ArgumentException, I looked into the PathState and it is ReturnQueue.

The usage for this is to periodically use FloodPath to get all nodes reachable by a save point.

Any suggestions would be much appreciated!

Ok floodPath.WaitForPath() (Coroutine) helps, it is able to wait- the issue is it isn’t finding a node close to the start point and failing, which is odd because ABPath.Construct has no problem with the Vector3 positions.

the FloodPath.Construct results in searched nodes, so it looks like the FloodPathTracer is the one which is failing, it searches 0 nodes.

!!! EDIT !!!
Looks like it is all good now… something with the NNInfo GetNearest()- I’m using my own Graph that extends from NavGraph- initially I thought maybe I should try extending from PointGraph to see if that helps, which caused the FloodPathTracer GetNearest to fail, so I switched back to NavGraph and it’s all working now. :slight_smile:

Great that you got it working! :slight_smile: