No announcement yet.

Multi Line trace that returns all hit surfaces, not just actors

  • Filter
  • Time
  • Show
Clear All
new posts

    [FEATURE REQUEST] Multi Line trace that returns all hit surfaces, not just actors

    Ive noticed that in order to get all the surfaces that a line trace hits you need to use multiple line traces. Could we have a new type of trace that will get ALL surfaces within an area that it hits? Im asking this because currently when a multi line trace (or shape trace) hits an object, it only returns the hit location, but not the exit location of that trace. This causes us to have to use not so desired methods to get the exit location.
    Stylized Low Poly Environment
    Stylized Low Poly Pine Forest
    Stylized Low Poly Buildings
    First Person Horror Template

    Line trace by channel should return everything hit as long as it has a collision. Don't see a point of adding a new trace that detects both forward and back since this can be done anyways. Either way, you will have to use multiple traces.


      You can't really *detect* backward collision, because there's nothing to collide with and collision detection doesn't really work that way, you can infer the backward collision from the initial collision though, just invert the normal, and to get the distance you can use the normal * surface thickness.

      Multi Line Trace returns an Array of FHitResult's, so you can iterate through that array to get all your hit information the same way you do for a single line trace.


        RaycastMulti only returns 1 hit result back and removes all of the rest of the results, it even says it in the source code:

        // Now eliminate hits which are farther than the nearest blocking hit, or even those that are the exact same distance as the blocking hit,
        // to ensure the blocking hit is the last in the array after sorting in ConvertRaycastResults (below).