Pathfinding under or over a bridge

I am trying to perform pathfinding on voxel terrain where pretty much anything can be built.

When I build a bridge, I want the AI to be able to go over it, or under it. If I scan the grid with a height testing ray length less than the height of the bridge, the AI can walk under it, but not over. If I set the ray length greater, the AI can walk over it, but not under.

Is there a way to show walkable paths both over and under with a gridgraph?

Perhaps having multiple gridgraphs, with multiple seekers, then choosing the seeker with the “best” path?


For that you either need to use a layered grid graph or a recast graph.
A recast graph will give you the best quality, but is likely slower to update (though it can be offloaded to a separate thread).