I am using the grid graph to calculate paths and was surprised to see the seeker return a path close to the target (but no errors) when the target is an unreachable position. What I was expecting was to not get a path or an error, if the target is unreachable. Is this behavior intended or am I making a mistake somewhere?
To elaborate a bit more: I am setting up a path and letting the seeker do its work on it.
var vector3Path = ABPath.Construct(agent.transform.position, targetPosition.value.position, null); seeker.StartPath(vector3Path, OnPathComplete);
If I check path.errors, it returns false and and path.CompleteState returns complete.
My path looks like this:
The last point on the returned path is as close as possible to the target and not on the node position but on the border.
I tried setting calculatePartial to false before seeking, but that doesn’t seem to have any effect.
The only way I found to deal with this is to use IsPathPossible beforehand and not letting the seeker look for a path if none is possible, as I don’t want to move my objects at all if they cannot reach their intended goal.
Is this the right way to go about this or am I missing anything?