Thanks for the quick response.
I don’t think a screenshot is necessary, as this test is happening on effectively a flat map.
Though, there are numerous graphs, for different sizes of units. I run a scan for all graphs before the gameplay starts, so I don’t think that should cause any problems.
I used to have a NavmeshCut component on the units, only enabled when completely stopped, but I have temporarily disabled that for a while now and still having the same problem with the second move always saying the second path always fails.
RichAI’s isPathing property shows false, even after setting a new destination. Reviewing your code, it appears that the destination isn’t checked until at least one frame later. To help get an accurate isPathing value, between the setting of the destination, and the actual pathing calculation starting, I have called SearchPath() immediately after calling the destination setter, and that seems to have solved that issue. Would that be any cause for alarm? I had not done that in my tests prior to the implementation in the game.
Do you think it could have something to do with the fact I disable the RichAI between each movement order? Update: I removed nearly all the disabling of RichAI, and also put breakpoints to see if I could spot anything awry with enabling and disabling. It still fails on subsequent attempts to generate paths.
I have confirmed that the destination position is indeed on the nav mesh, not that it was really necessary, seeing as the first and second attempts assigning the destination uses the exact same method.
I am really stumped at this point, and I am incredibly behind my due dates, which is what led to me radically changing pathfinding solutions this late in the game…
(On a side note, I did note one issue with BaseAI’s movement: if you have a kinematic rigidbody it still tries to use rigidbody.MovePosition, which only works when kinematic is false. I added a “&& !rigid.isKinematic” in BaseAI’s movement code to ensure it uses transform.position instead in this situation.)