So this is in relation to another question here: http://arongranberg.com/vanillaforums/discussion/252/checking-if-a-destination-is-on-the-grid-graph#latest
I have a monster that will randomly pick a path point within a circle radius of itself, because of the randomness, of course this point could land on an obstacle, in which case it would redraw the path. I also have conditions so that the path isn’t too short or too long. The conditions seem to work, my problem is that it draws a path on an obstacle and seems to think it is a valid path.
So in the screenshot, I’ve been able to calculate my pathLength by pathLength = path.GetTotalLength(); I’ve determined that it is about 14 which is > 10 and < 100 so it is valid. However the path is being drawn on to an obstacle, so I’m not sure how it’s getting valid pathLength.
I was under the assumption if it picked a point off of the grid then vectorPath would be null and GetTotalLength() would be positive infinity. http://arongranberg.com/astar/docs/class_pathfinding_1_1_path.php#a1076ed6812e2b4f98dca64b74dabae5d