I’m trying to find the most effective way to make certain areas of my graph unwalkable.
I have 2 cases to handle:
-
Certain dynamic objects need to create entirely unwalkable areas - For example a fallen tree. I was just using a graph update but due to AI step height it was creating a walkable path along the fallen tree trunk which caused pathing issues as it was too narrow to actually walk on in some places. I put GraphUpdateScene on a boat that will update the graph when the boat lands on shore. What I don’t get is the rectangular gizmo. What is that for and does it have any effect on the graph changes? It doesn’t rotate with the object.
-
blockout out large areas of a map like a water line - I thought drawing some points along the water edge would be easy but after scanning I’m not sure this will work.
Here’s a zoomed out view of my map where I placed points along the water edge. After a scan it has made tiles unwalkable, but the tiles are large so I get this jagged border that I don’t think is going to work.
Or is there a better way to blockout areas of a recast graph to make them unwalkable, either for areas of the map or on dynamic objects?
My main strategy so far has been to have a hidden mesh on an object on on the map with a very tall height so that breaks the navmesh pathing around that object with no way for the AI to get on top of it.
For example here’s my tree with a hidden capsule collider that affects the graph update.
Would it make sense to use GraphSceneUpdate on the tree? Can I calculate and set the points using the tree bounds after the tree has fallen over?
When the tree is cut down I do a graph update. Sometimes this is a problem due to where the tree falls as one end may be too close to the ground connecting the graph.
I think this is what would work, I added graphsceneUpdate at runtime and manually rescanned. I’m just not sure how to do this through code at runtime since the tree may fall anywhere, rotate etc.