Layered Grid Graph does not carve grid for obstacle with layer above

Just bought the Pro version. Was fiddling around with the Layered Grid graph and don’t know how to solve this issue: (zoom into image for better view)

As you can see indicated by the green arrow, the obstacle is considered when building the extra layer (look at the top of the box), but it is not actually blocking the lower layer, even though it clearly does so. I thought that could be related to where the library tries to sample the layers, so I’ve changed its height so it extends a few 10s of units below ground, but the result is the same as a “shallow” block.

A similar problem can be observed on the “arch” to the right: it only cuts the node connections precisely intersecting with the grid, not the borders of the arch, which would be of unsufficient height for anything to go through (only the center should be navigable below).

Here is the setup for the layered graph:

If I set the obstacle’s layer to something other than default and add that layer to the “Collision testing” mask, it does block the grid, but then it doesn’t create a second layer.

How can I get the lower layer to be blocked?

Tried a different scene, using a cube instead of the terrain, since that could be one of the factors, but nope, the same behaviour is observed. New layer created, but no blocking where there should be.

Hi

You have configured everything as being included in the ‘Height Testing’ layer mask, but there is nothing in the ‘Collision Testing’ layer mask. When an intersection with the ground has been found, it will check if that node is unwalkable or not by checking if any colliders included in the ‘Collision Testing’ layer masks are close to that point (the exact shape depends on the ‘Collision Type’ field).

I think you want to add the box’s layer in the ‘Collision Testing’ layer mask.

If I set the obstacle’s layer to something other than default and add that layer to the “Collision testing” mask, it does block the grid, but then it doesn’t create a second layer.

When the obstacle is in a collision-tested layer, the layer generated above it is entirely unwalkable.

Hi

Yes, that’s because it is detecting itself as as obstacle. You can offset the capsule that is used for collision detection a small amount upwards to prevent this. Set the Collision Testing -> Offset field to something like 0.3.

1 Like

Ah, that makes sense. Will test when I get home.

It worked! Thanks for the support.