Hi, I’m using Unreal 4.26 and writing my code in C++.
I am trying to essentially “simulate” a 2D LiDAR unit, where hits with visible items in the scene are recorded. Basically, a few hundred lines are traced at various angles and then lines that intersected with something “visible” are recorded. (The LiDAR has a high field of view, like 270 degrees, which complicates just doing this with a camera render and depth buffer check.)
However, when I try to do this by using line tracing with ECC_Visibility collision channel (see code below), it doesn’t seem to work in all cases. In particular, the tracing works fine for “solid” objects that I placed manually, but landscape foliage like grass are completely ignored.
FHitResult HitResult;
GetWorld()->LineTraceSingleByChannel(
HitResult,
StartPoint,
EndPoint,
ECollisionChannel::ECC_Visibility
);
For example, the “block” which has collision seems to be detected just fine:
But the LineTrace seems to not detect the grass:
Is there a way to make LineTrace not ignore the landscape foliage (which do not themselves have collision, but are visible)? Or should such a task be done with some other method (and if so, pointers would be much appreciated!)

