Restricted pathfinding Area

So i’m triying to create a little diablo like game ,and using the Aron Granberg’s
Pathfinding-Tool (free version) to handle the "click to move part.
i want to add a little trap system where the hero get stuck inside an area, so he will have
only the possibility to move inside this trapped area, so far everything is fine
however when i click outside the trapped area, the hero try to reach the destination
even though the wall will prevents him from reaching it.

so my question is, is there any way to restrict the area where the pathfinding system work to the
trapped area dynamically.

and wich Graph Type is recommended to use in this situation or this kind of Games (Grid Graph/Navmesh Graph/Point Graph).

Thank you.

image for explanation:


Have you updated the graph to account for the added walls (I assume the graph needs updating)? See

You might also want to reduce the Max Nearest Node Distance in A* Inspector -> Settings to make the seeker realize it is trapped and not try to get really close to the edge instead (but this is optional, in fact you might want the other behavior).

If you are going to update the graphs (like with this trap), the only viable graph type is the grid graph (or the grid graph based LayeredGridGraph). Point graph can work as well of course, but I doubt that the behavior you would get from those is what you want in your game.