First non-overlapping point from trace?

Is there a way to return the first point on a trace that is not overlapping anything? This would be really useful for a lot of situations. Just curious if there is a method to do this already?

An example of what it would be useful for: start a trace inside an object, then end it a really far ways above the impact point. Returning the first non-overlapping point would give you the top location of your object.

Hi man,
i think you can do the exact reverse,
do a linetrace from above toward your char and get the hit ,

so instead of doing the linetrace from inner char
do the thing from extern

If I understood this correctly, you’re after Sweep:

The sweeping geometry must be blocking. Vid: https://i.gyazo.com/005c2f5bb691971e…6320ddf69a.mp4

It’s useful for all sort of things, most commonly for placing odd shapes on surfaces without intersecting - as component bounds will often fail here. It’s also a good idea to dedicate a separate channel to the whole process.

Without sweep:

Hello,
I thought about doing this initially, but realized if my geometry wasn’t very simple or had some overhangs, that it might cause my check to fail. Ideally, I want the “top” point closest to my player location. If you look at this example here, the red line is the trace, and the black arrow points to a situation where the desired point isn’t found:

An idea on my list to test is maybe a multi-hit line trace? Then I sort the hits, get closest to my target Z, then dot product the normal against the world up vector to make sure it isn’t facing inside:

Currently, what I am doing is a small sphere trace that starts from the wall at player z, and using a for-loop with break, it “climbs” upwards on z with a grid distance until it no longer overlaps anything, then does a final trace down to get the true point. I’m worried about the performance of “for” loops in blueprint, and also with the possible inaccuracy of stepping the sphere up on a grid: maybe it steps 1 unit too high and just misses a small gap!
I see plenty of shaders that can “edge detect” obstacles, but never any info on returning that data to be useful in BP!

@Everynone thank you for this suggestion! But I think it wouldn’t help me here. The goal is to detect ledges on geometry for a valid grab/grapple point. So I need a way to “scan” obstacles until I get a valid ledge, not return the closest depenetration point.

Understood, my bad.

well, if you plan that , you may have a small grab point at any high and everywhere, there is no quick solution, i think…
some games was placing special object to detect when trying to climb…
if you dont have many custom stuff you could place them.
Otherwise as you said, if you have really small grab-point you may miss them using almost any detecting thing.
by the way
you should be able to cast like, 8 linetrace in front of your char without too much bad performance,
If you detect a “hole in the wall” with one of the rays, you can always wait the next frame to cast more rays to defin the grab point.

in case of “ramps” ??? or stairs , you will have to mess up with detecting!
An inclined surface is a grab point?
stairs or piled boxes, are a grab point too?
A tree with a strange shape, mayy offer a grab point too.

well sound hard define what shape is and what no,
mayve is better find some kind of trick …