Line Trace goes through Landscape

I want actors to spawn on Landscape and am trying to trace a line between the actor and landscape to achieve my goal, but there is no hit result. I really can’t find out what’s the problem. The trace worked when it hit another actor object, it just doesn’t work with the landscape.

123657-kuva1.png

123658-linetraceoptionslandscape.png

Here are the Collision options for Landscape.

Is this C++ or blueprint ?

Can you try this ? I created a simple cube place it high above my landscape and added this lineTrace script to it. And it detected the hit properly on the landscape.

Are you using the LineTraceByChannel or the LineTraceForObjects ? (or the multi version)

Thanks

  • Marc

The issue is your landscape’s collision setting for the trace channels is set to overlap. The one you’re using should be set to block in order to generate a hit result.

It’s blueprint and my bp is not very different from yours. I also tried to do exactly the way you did, just in case, but it didn’t help.

Edit: And for demonstration purposes I added a cube on the map where one of the trace lines go, and the trace hits it without any problems. So the fault should definitely be with the landscape. : |

I tried many different combinations of those yesterday and any of them didn’t do the trick. I changed it back to block, as it was as default and it’s not helping either.

Aah, I can’t believe it… It doesn’t work when the trace goes from under the landscape, but when I spawned the objects above it, it suddenly worked… The landscape is only one sided, that was the problem all the time. Well, now I know that too. :’ D
I hate it when it’s the simplest things that gives you errors.

1 Like

Thank you so much, I met this problem and inversed the trace direction, then problem was solved!
Anyone who met the same problem should have a check for your line trace direction, the heigher point should be the trace start!