Why is my LineTraceForObjects not detecting a hit on my terrain?

I’m experiencing a weird issue when attempting to use LineTraceForObjects in Unreal Engine 5.

In Unreal Engine 4, we are able to detect hits no problem on complex terrain. In Unreal Engine 5, the same hits are not detected if the mesh underneath is too complex. For reference, we are using Cesium Unreal for Earth terrain.

Here is an image of the trace working on lower quality terrain, and it not working on higher quality terrain.

Here is the Blueprint (we were using C++ but I’ve reverted to Blueprints for faster debugging)

Here is a picture of the same result with much higher resolution terrain data in UE4.

Has anyone else experienced this, and if so, any ideas on how to fix it?

1 Like

As an update for this morning, I’ve tried using Box trace, Sphere trace, and Capsule trace all with no luck. Even adding it to a tick and re-tracing it is resulting in no hits every second, only when I zoom far away and the mesh complexity reduces.

As an additional issue, I can only see my LineTrace debug line if I’m at a very specific angle, unsure if that is tied in with my issue or a separate thing altogether.

Have you checked your trace channels in Project settings that they are the same as the ones in your original project? Is collision settings in trace match up with that of the terrain? Just guessing, you may have checked all this already.

Yeah, I did check. Nothing out the ordinary there. I know they are working “correctly” as I’m able to get hits on lower-poly meshes. Whenever I am casting my own sphere trace on click, it will pass straight through the mesh as well.

Going to bump this one again. I talked with Cesium and they provided some insight. It does not appear to be a direct issue with the terrain, but rather something with the tracing.

Here is the C++ code;

And this is the result.

I’m able to right-click and receive a hit in the exact same location from the exact same height.