WTF Is? Multi Line Trace By Channel in Unreal Engine 4 ( UE4 )

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ส.ค. 2024
  • What is the Multi Line Trace By Channel Node in Unreal Engine 4
    Source Files: github.com/MWa...

ความคิดเห็น • 19

  • @palamandre
    @palamandre 4 ปีที่แล้ว +6

    You are doing an amazing job explaining all those things. Keep it up it means a lot :)

  • @qdeanc
    @qdeanc 8 ปีที่แล้ว +1

    Thank you so much for this tutorial. It's EXTREMELY helpful. I do have a question:
    If the Multi Line Trace begins inside of an actor, it returns a hit value with an impact normal of (0,0,1) at its starting location. Is there some way to make the Multi Line Trace only return hit results from surface normals instead?

    • @MathewWadsteinTutorials
      @MathewWadsteinTutorials  8 ปีที่แล้ว

      I just tested using my examples and printed out the Impact Normal from my character as I ran thru it. It gave me back the valid values as I expected as it hit the collision capsule on the player. The normal was correct and returning a valid value as I moved and the area it hit on the capsule changed.
      The only time I got back the same Normal value was if the surface was flat, which is the value I expected, or I had the Ignore Self boolean unchecked which would cause it to hit itself as the first point of contact every time.
      Do you have a screenshot perhaps of the issue or maybe some more details?

    • @qdeanc
      @qdeanc 8 ปีที่แล้ว

      Of course.
      This picture shows the Multi Line Trace. It begins inside the glass cylinder and ends coming out of the top:
      gyazo.com/d9ab263ddf23eb6c2017e1da605daa5d
      This picture shows all of the objects and impact normals from the Multi Line Trace hits:
      gyazo.com/1eb83bb92009da781f5cef84f3f19b81

    • @MathewWadsteinTutorials
      @MathewWadsteinTutorials  8 ปีที่แล้ว

      I can't be too sure of what is going on but some things off the top of my head.
      I think I see 2 traces, one in the background with 1 hit and 1 thru the bear with no hits. It looks like the trace from the back is hitting the cylinder as it leaves it and assuming its on the correct channel for your trace (possibly visibility) then that would make sense assuming your line trace nodes are in a Blueprint that is separate from your Glass Cylinder it is hitting. This having only 1 hit would make sense as it hits the cylinder and then nothing else is in the way before it ends (and why it only shows the 1 green cube for the impact). the -1 in the Z would be correct for the normal as I would think you are projecting this from below and its the impact point going down. These are all guesses of course.
      As for the other trace I don't really see what it is hitting, if anything at all, but that would be a completely separate trace from the looks of it as you have 2 on the screen. Check to see what your line trace channel is set to and that your desired item you want it to hit against will block that channel. It's possible you want to maybe use a line trace by object if your trace is intended to be more specific like against a player or enemy. This might work easier?

    • @qdeanc
      @qdeanc 8 ปีที่แล้ว

      The line trace is produced by the bear's blueprint and not the cylinder. Its green hit square shows a (0,0-1) hit at its start location inside the cylinder instead of on the surface of the cylinder. I don't want it to produce any hits at all considering that it begins inside the cylinder and exits through the back of the cylinder's normal. So the problem is that, when this trace is generated from inside an object, it automatically registers a hit at its start location with a normal vector opposite to the trace's normalized vector regardless of whether it actually hits the surface of the object.

    • @qdeanc
      @qdeanc 8 ปีที่แล้ว

      +Mathew Wadstein I'm referring to the Line Trace on the left, just to clarify.

  • @dangerousmindgames
    @dangerousmindgames 2 ปีที่แล้ว

    You think they used something like this for collateral damage in COD games?

  • @sanketvaria9734
    @sanketvaria9734 5 ปีที่แล้ว +1

    what is the name of that 'Get' node? I am unable to find it in my Unreal.

    • @taylorhead9842
      @taylorhead9842 5 ปีที่แล้ว +1

      I know this is an old post, but I had the same issue and maybe this will help someone else? From the MultiLineTraceByChannel drag out from "Out Hits" to make a "For Each Loop" node. From there you can drag out from "Array Element" to your "Break Hit Result"

    • @maximevigneron560
      @maximevigneron560 4 ปีที่แล้ว +1

      @@taylorhead9842 it helped ^^

    • @taylorhead9842
      @taylorhead9842 4 ปีที่แล้ว

      @@maximevigneron560 💪💪

  • @ne-fala
    @ne-fala 3 ปีที่แล้ว +1

    overlapp..... ohhhhhhh. thanks.

  • @PasteteDoeniel
    @PasteteDoeniel 6 ปีที่แล้ว

    I got one question. How did you debug the linetraces like that?

    • @BR14Nx
      @BR14Nx 3 ปีที่แล้ว

      You can set the "draw debug type" to "for duration" or "persistant" in the node

  • @MichaelSmith-gd4gv
    @MichaelSmith-gd4gv 8 ปีที่แล้ว

    Is it possible to get to the location and the normal of where the trace exits the mesh?

    • @MathewWadsteinTutorials
      @MathewWadsteinTutorials  8 ปีที่แล้ว +1

      As far as I know no. Normally to find this you would trace backwards from the end and that would give you the exit point.