Add Walkability on "Erosion" collision zones - typically for doors

Hi Aron,

Congrats on realizing one of the most useful plugins for Unity, and with such high quality !

I’m building a top view infiltration game. I’ve built the mesh for a realistic house, and use a grid graph to allow NPCs to navigate into it.

Although, as proportions are respected, the door is only about one meter wide, so if I add a little “erosion” to avoid having the NPCs walking into the walls, the door also becomes non walkable…
To prevent this, I’ve tried adding a Graph Update script on the door area, which sets “walkability” to true.
=> this doesn’t work (at least on version 3.2.3), walkability can only add more unwalkable areas (at least when unwalkable areas have been added by the “erosion”)

Is this a bug, or just not the way to use it ?

I think I’ll soon buy the pro version of A* pathfinding. In the case of “realworld” dimensions, is the Recast Graph better / easier / faster to your experience than grid graphs ? From the screenshot it seems it allows multilayers (for floors).
Can it work with real life dimension stairs, or does it also require some kind of erosion incompatible with narrow corridors ?

Is “wall avoidance” better with Recast Graph ? Do you have any video showcasing the pro features ?

Thanks for all your work and for your help !



That is a very good point. I have added a toggle to ignore erosion when updating graphs to the dev version so it will be included in the next version. Or if you decide to buy the pro version you can download it directly (download the dev version on the downloads page). Docs for new toggle

Recast graphs might still have problems with doors being too narrow, but they often handle it better since they have better accuracy.
Recast graphs can handle stairs and multiple layers.

I do not have a video currently (except for local avoidance). But you can a demo of the recast graph here:

Hi Aron,

Many thanks for your detailed answer.
Do GUOs also work with Recast graphs ? Because if my door is too small, I need NPCs to use it anyway… And I need a GUO to say when the door is closed/open.

In the Recast demo, the bot never gets stuck when going around a wall, which seems perfect for me. I’ve also loved your local avoidance demos.

Are the example projects (with local avoidance & recast) downloadable or included in the pro version ?


GUOs work for recast graphs. However they can only update existing nodes. For doors and similar, this is usually fine since the generated polygons are usually small in choke points (e.g doors). There is actually an included example scene in the pro version named “Door” which shows a recast graph with a door which can be closed and opened.

All demos are from the example projects included in the pro version.

Hi Aron,

Thanks a lot. Your support quality is as high as that of the software :wink: