RichAI + StartMultiTargetPath not working

Hi there,

I’m using a subclass of RichAI to add in a call to StartMultiTargetPath from the seeker. I have the points working fine, I can use debug.drawray to visualize the endpoints sent into StartMultiTargetPath and they appear correct. I make the call into StartMultiTargetPath, asking for all paths to be calculated.

I’ve temporarily altered the RichAI.OnPathComplete method to enumerate the points returned from the StartMultiTargetPath call. I then draw the endpoints, again with rays, and color the ‘chosenTarget’ blue, and all others white. I can clearly see that the closest path is indeed the chosen target.

However, the agent will then try to walk to the farthest path! I’ve debugged though the richPath.Initialize call, and it seems to be selecting the shortest of the two paths, but ultimately the a* unity path visualizations show the agent wants to go to the farthest of the two paths.

Second… the second path isn’t even possible to get to! The setup is a building, with a closed door. I am using tags and the bounds of the door to flip between a navigable tag and a not navigable tag when the door is closed. (this is based on the door1 example). The door is closed, and I have a guide point on each side of the door. One outside and one inside. These two guide points are to become the two points I want A* to search out and walking to the closest. With the door closed… only ONE of the points should even be possible. It’s like the StartMultiTargetPath line of code ignores tags?

Any advice?

I found the issue for the agent not moving to the nearest target… When calculating the path endpoints using CalculatePathRequestEndpoints, I was resetting the destination to each point in turn. I needed to reset the destination to the choosen point in the RichAI.OnPathComplete method! (oops) It seems RichAI is not really designed for StartMultiTargetPath…

However, my second issue of a path being found to a location that shouldn’t be accessible remains.