Layered Grid Graph

I have just started using A* pathfinding. I have watched and read much of the training material and believe I have a reasonable grasp of the concepts.

I am struggling with Layered Grid Graphs.

  1. My walls and ground are one mesh. If I don’t tag the walls as obstacles (which I can’t do in some cases), the path can continue straight through the wall? How do I stop this. I tried using Thick Raycast, but get warning, this is unavailable for this graph type.

  2. I have a ramp that goes underground.
    You can see in the first image a grid at the bottom. This shows the graph from underground. It stops at the overhang.
    The second image shows a top view, and you can see that the part of the ramp that is open above ground has the red squares, which I believe indicates it is unwalkable. At least they don’t follow the slope of the ramp.
    What do I need to tweak to make the ramp walkable? (Note, Max Climb has been set appropriately and works on underground section of ramp which has the same slope. Also, if I just use a Grid Graph, the ramp becomes walkable…)

  3. I have lots of stairs, see 3rd image. It is really hard to see each layer graph. when they overlap, to see if the stairs have been walkable. Is it possible to hide/show each layer of graph?

Hi

For the visualization, try enabling Unity’s 3D gizmos. That helps a lot in these cases.

  1. Are even your colliders the same? Are you just using a big mesh collider for everything?
    If so, sorry, the graph needs to be able to differentiate between the ground and the walls. Can you split the mesh into two parts?

  2. Hm… it’s hard to know exactly what could cause it. So I will just write a small checklist here:

  • Are you sure it has a collider which is detected by the graph.
  • Are you sure the erosion is not set higher than it should be.

Looking at it, it looks like there are not even any nodes generated there (not even unwalkable ones), so it seems to be completely ignored.
Could you post a screenshot of the settings that you use?