Pathfinding into an unwalkable node is succeeding when it should be failing


I’ve started noticing that my units were walking into areas they shouldn’t be. So I just created a simple test that makes a seeker walk around inside a region which is marked as unwalkable, and it’s successfully finding a path. :expressionless:

Am I doing something really daft?

Here is a video of the problem


Really, no ideas?

I grabbed this from the Help Guide…note the second paragraph…I updated my seeker calls to use this method and now i get an error whenever the node is unwalkable…using the default settings I would get a path no matter what…

//Create a new path object, the last parameter is a callback function
//but it will be used internally by the seeker, so we will set it to null here
Path p = new Path (transform.position, transform.position+transform.forward*10, null);
// By default, a search for the closest walkable nodes to the start and end nodes will be carried out

//but for example in a turn based game, you might not want it to search for the closest walkable node, but return an error if the target point
//was at an unwalkable node. Setting the NNConstraint to None will disable the nearest walkable node search
p.nnConstraint = NNConstraint.None;
//Start the path by sending it to the Seeker
seeker.StartPath (p, OnPathComplete);

Great, that worked. Thanks bazzer. :slight_smile: