Is there a way to trace only the terrain? Or get the terrain height at a specific point?

Hey guys,

I am working on a teleportation spell that will allow the players to teleport through walls and stuff. But I don’t want them to go through the terrain.
The current method is to do a step trace like what you do in Ray March, and find the longest non-overlap location. But the terrain proves to be a problem.
I can’t use line trace because I have a lot of props using the same collision channel/profile as the terrain. Multi trace doesn’t work obviously because those props need to be Blocking instead of Overlapping.
So any Ideas that I can only trace a single Actor? Or to calculate the height at a specific point?

Any help will be appreciated, Thanks!

Landscape is an actor.select it on world outliner,give it an actor tag.when tracing,check if it has the tag.

The problem is that I have multiple other props around and they block the trace. And once it’s blocked, the trace won’t continue to reach the terrain. I do want player to be able to go inside some hollow spaces like rooms/ boxes.

Multi line trace,and then for loop to check the tag.or create a new trace channel , make the terrain to block the new channel,props to ignore.

Thank you! But we ended up exposing the TraceSingleActor function from C++, I will try this solution on the next update!

Also, Multiline Trace will still stop tracing if it’s a blocking hit. This function only continues if it’s an overlap hit. FYI.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.