Robmaister / SharpNav

Advanced Pathfinding for C#
sharpnav.com
Other
537 stars 128 forks source link

FindRandomPoint (and OnCircle) sometimes return false #43

Closed AqlaSolutions closed 9 years ago

AqlaSolutions commented 9 years ago

Some calls to those can return false periodically while others work for the same navmesh. This depends on Random.Next value I think.

Robmaister commented 9 years ago

FindRandomPoint should no longer be returning a bool. What version of SharpNav are you using?

I would recommend v1.0.0-alpha.2 or compiling it yourself from master.

If the issue still persists, could you send me a seed for Random that exhibits the bug (by using the NavMeshQuery constructor that accepts a Random, and the Random constructor that takes a seed value) and your navmesh?

You can export your navmesh by running the following code:

var navMesh = ...; // whatever your navmesh is in your code
var serializer = new SharpNav.IO.NavMeshJsonSerializer();
serializer.Serialize("test-map.json", navMesh);
AqlaSolutions commented 9 years ago

Hmm, I think we are using a bit outdated version. I will post here if it will be reproducable after the upgrade. For now you can consider it closed.