Agent attempting path despite no possible path to target

I have a grid setup with certain objects tagged as an Obstacle and not traversable. The problem I’m having is I don’t want some agents to attempt a path if it can’t actually get to the target due to obstacles. Right now, the agent will calculate a path that gets it as close to the target as possible.

I’ve tried using PathUtilities.IsPathPossible but it seems to always return true since I think it is just checking the calculated path to get closest to target. Is there something else I can try to get the behavior I want?

I figured it out. I kept trying to pass the calculated path graphnode list to the IsPathPossible. Then I saw there was an IsPathPossible that excepts two nodes, a start and an end. That’s what I needed!

1 Like