Linecast returning bad hit

Hi!

We’ve got a custom movement script that’s a hybrid of a physics based character controller and a navmesh constrained/clamped mover

In order to do the navmesh constraining we use the Linecast api, but we’ve been seeing some random “invisible walls” which usually change position when rebaking with different settings or when the map changes
There’s no “degenerate triangle” warning during baking - we first suspected that, and after changing the settings to eliminate the warning the “invisible wall” was indeed gone, but only through changing the settings and thus “moving” it

I’m kind of at a loss now and pretty certain this has to be a bug/edge case in the linecast or graph generation

We’re on 4.2.15 (which is the latest version currently)
This is what it looks in game: https://share.dl.je/2020/06/2020-06-03_07-19-12_nvLm1klQ4F.mp4
Movement script is getting a hit here: https://share.dl.je/2020/06/2020-06-03_07-22-16_dSfPqZcFw9.png (debugger)
Pink line is the reported hit (slightly offset so you can see both lines): https://share.dl.je/2020/06/2020-06-03_07-24-50_JpgV0wvqnF.png
It only seems to report the hit in on direction aswell https://share.dl.je/2020/06/2020-06-03_07-28-19_9qqbivs0mu.mp4

I’d be more than happy to send over the graph cache if that helps investigate it aswell

I did try debugging the Linecast call myself, but I don’t fully understand how it’s working so aside from it not hitting any of the edge cases/early returns I couldn’t really see anything

Hmm… That’s odd.
Can you enable the ‘show connections’ mode on the recast graph to see if those two nodes are connected to each other?

Also, you might want to try to beta version (https://www.arongranberg.com/astar/download) which has a few fixes related to linecasts on recast graphs.

Are you using any navmesh cutting?

Can you enable the ‘show connections’ mode on the recast graph to see if those two nodes are connected to each other?



(with and without connections - pink line is the reported hit)
That explains why it’s getting the hit at least, the node isnt connected!

Also, you might want to try to beta version (https://www.arongranberg.com/astar/download) which has a few fixes related to linecasts on recast graphs.

We’re not on 2019.3 yet unfortunately and won’t be for a few more months at the current rate

Are you using any navmesh cutting?

Nope, static pre-built navmesh
The only thing we’re doing is postprocessing the navmesh to delete any unwalkable areas, but disabling the script (by returning at the start of the OnPostScan callback) doesn’t change that area at all - same unconnected “bit”

Odd. Those nodes really should be connected…
Is the ground complately flat there? Can you see any seam in the navmesh visualization?

Yeah, as far as I can tell it is (quick check by putting a plane flat on the ground passes aswell - no hills clipping through only some z-fighting, whole thing appears/disappears)

As in zoom in on the gizmo render? no gaps to be seen