AI Line trace hits geometry, error messages

Hello,

I have a problem with AI detection by line trace hitting geometry in my level and returning a lot of error messages (returned none). I was wondering how I could avoid this? My level outlines and paths are built entirely out of geometry box brushes, is that the wrong to go about it?

Here’s a screenshot of the level I’m building:

Now what happens is that if I use for static mesh as walls, the enemy AI is fine, no error messages. But when I use this geometry, the message log gets flooded with returned none on break hit result (I’m also using an isvalid check in the detection).

Here’s a screenshot of the detection script:

It is modelled somewhat after the official example by Epic, where it uses a multisphere trace for initial detection and follow-behavior, but follows based on the visibility line trace.

Hope someone has an idea how to get rid of this error! What I could potentially do is convert everything to static mesh or potentially add a blocking volume along all walls, but I’m not sure how this will affect performance.

You can try to add if after sphere trace (I know you are checking it later but it may be reason)

Is this trace working?

There’s already an “isvalid” after sphere trace, and both a branch and an “isvalid” after the line trace.

And yeah the trace works just fine, it does exactly what it should and as long as there’s a static mesh and not a geometry brush between the enemy and the player it gives no error messages.