Unreal Engine 5 Tutorial - Using Line Tracing

Поділитися
Вставка
  • Опубліковано 31 жов 2024

КОМЕНТАРІ • 37

  • @srawdawg6188
    @srawdawg6188 6 місяців тому

    I never understood line traces before this video. Everyone wants to teach, but not everyone can teach, you can teach brother, good job!

  • @LehushasProduction
    @LehushasProduction 3 місяці тому

    What a nice tutorial!! It helped me with a completely different problem, but thanks to you I saw how to connect rotation properly, thankssss!

  • @atharvatandel7139
    @atharvatandel7139 Рік тому +2

    Great Tutorial for Unreal 5, all other tutorials i found were for unreal 4 mostly.. and this was really helpful thanks..

  • @SergeyBel
    @SergeyBel 5 місяців тому

    omg dude that is literally the best explanation I have found so far, and I was searching a lot for a good explanation, thank youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

  • @YQ4869
    @YQ4869 7 місяців тому

    The custom trace channel tech is soo helpful, thanks for the tutorial!

  • @JAPAWEI74
    @JAPAWEI74 2 роки тому +4

    Very good, concise tutorial. Keep it up, great stuff!

  • @johnrex7108
    @johnrex7108 8 місяців тому

    Terrific video, man. These videos have helped me a lot. Earned yourself a subscriber.
    That being said, anyone else notice anything "funny" around 33:25

  • @billysatkowski6938
    @billysatkowski6938 Рік тому

    Thank you for explaining this. I'm trying to get a spider to walk on walls. This should work perfectly as a start to my blueprint.

  • @mauromarquet701
    @mauromarquet701 6 місяців тому

    I loved the tutorial! Congratulations. I have a question for you. I want to perform a line trace by profile inside the animation blueprint, but I want the line to start from the head and go down to the ground. By default, the line starts from the waist, and I need it to set up footstep sounds at different depths of water. Thank you very much!

    • @ArtofficialEntertainment
      @ArtofficialEntertainment  6 місяців тому +1

      You would just need to alter the actor location. If you add a value to the Z of the actor location before adding to the rotate values it will change the starting position. Just play around with the add until it starts where you want it :)

    • @mauromarquet701
      @mauromarquet701 6 місяців тому

      @@ArtofficialEntertainment Thanks you so much. You know, I did it that way already; I drew two lines, one downward and one upward, to calculate the sound of the water when I'm almost fully submerged, but still with my feet on the bottom.

  • @synastershred2269
    @synastershred2269 Рік тому

    Can you do a tutorial on adding a third person cover system using line traces?

  • @ga9Z
    @ga9Z Рік тому

    Great tutorial bro! Can this also be used in the Soccer game? I would like to add an animation to the goalkeeper to detect exactly when he needs to catch the ball..

    • @ArtofficialEntertainment
      @ArtofficialEntertainment  Рік тому +1

      It can but for a smooth catch system you would need to also use something called motion warping. Its a system that allows you to move animations to locations set by a line trace or any other location data. So you would want a trace for the ball (give some chance for failure) and then once detected set the hit actor object as a variable (which would be the soccer ball) then make a custom event to call the motion warping system to move the character to the balls location, and call that custom event off the branch of the line trace, then attach the ball to the goalies hand if successfully caught using attach actor to component.

    • @ga9Z
      @ga9Z Рік тому +1

      ​​​​@@ArtofficialEntertainment *Thanks for the reply, yes good idea for Motion Warping. I understand in a way, but it is not clear to me whether I should put the "trace line" on the ball or on the player?*
      *Because I want to insert more animations that change according to the speed of the ball. For example: can I add trace lines to the goalkeeper animation?*
      *if you could make the trace line longer, there would be a longer animation when there was a collision with the ball - that is, a shorter trace line for a shorter animation.*
      *I'm trying to make soccer 1 vs 1 so I want to figure out the logic. But there aren't many tutorials on sports games..*

    • @ArtofficialEntertainment
      @ArtofficialEntertainment  Рік тому +1

      @@ga9Z if you are wanting to have animations based off ball speed, you'll need a few parts. Something to calculate the vector XY velocity of the ball to know when to execute certain animation types. And the trace would be best coming from the player outwards. Possibly best to use a sphere or box trace to increase the detection area.
      Then using the line trace you can set the object value as a variable that you can use to get actor location so you can use this in the motion warping piece.
      There's sadly a reason why sports games aren't as heavily developed and that's because with today's systems it's a lot of moving parts to make fluid.

  • @kinwer93
    @kinwer93 Рік тому

    Hey, very nice tutorial. I have an issue, for some reason I can't hook up line trace by channel to break hit result. Do you know how can I fix this?

    • @ArtofficialEntertainment
      @ArtofficialEntertainment  Рік тому

      It's not a hook up - you pull off the blue pin on the line trace outputs and type in break hit result there. It's a structure predefined by the line trace so requires it to be pulled off the line trace itself - can also right click and click on "split struct pin" to expand the hit results on the line trace node itself rather than having a hit result node that's separated

  • @RMC_
    @RMC_ Рік тому

    Do you have to have an end point to the line trace? or can you set infinite distance?

    • @ArtofficialEntertainment
      @ArtofficialEntertainment  Рік тому

      Never want to set infinite distance as it will crash. Infinite anything is the cause of most crashes as the calculations have to end in order to start the next process and having to calculate an infinite distance in an infinite space means it won't be able to move on to the next set of calculations.
      Now with that said I'm not entirely sure how you would set it to infinite on a trace unless you run it on an event tick and set the trace end to be the previous trace end + a float multiplier so it will just go endlessly but again very dangerous and will cause crashes if it doesn't hit anything and has to keep going

    • @RMC_
      @RMC_ Рік тому

      @@ArtofficialEntertainment haha yeah that would be a bad idea... I was more wondering if you had to set an end point for it to work, which it seems like you do. But I'll just have to add zeroes until it tells me to stop :)

  • @ryanjdevlin87
    @ryanjdevlin87 10 місяців тому

    I know i need to learn the basics of vector math alot more but how do I compensate for North/South VS East/West when adding to the X and Y values directly. like say the char is face north ... the x value is his right and left ... but when face east... the Y value is his left and right ... how do i compensate for that ?

    • @ArtofficialEntertainment
      @ArtofficialEntertainment  10 місяців тому +1

      If you want to have direct north south east west with fixed positions no matter the facing direction then that's a bit harder. Possible to use world vector values but really line trace should be used for character item identification and as such will generally be best if used based off either camera rotation or actor rotation and then can get the right vector or the forward vector. Then when you multiply the float value, positive numbers will go in the direction of the vector (so forward vector goes forward), a negative number goes in the opposite ( so forward vector now becomes the behind vector) and same goes for right and up vectors. Positive goes up or right, negative will go down or left.

    • @ryanjdevlin87
      @ryanjdevlin87 10 місяців тому

      @ArtofficialEntertainment thanks so much, so what I'm doing is building a ledge hang mechanic with shuffle side to side movement. I got everything working good as long as when the player attaches to the wall his left and right is the x axis when I rotate the wall 90 degrees and his left and right would be the y axis the whole system breaks because I have everything setup to use the x axis for left and right... I could check the players rotation and determine what the value of his z axis is but that seems super sloopy and could break if the walls aren't always at 90 degree angles I would.think ... any help would be so.much appreciated ! Thanks again man

  • @kjdee140
    @kjdee140 Рік тому +1

    32:47 I'm a grown adult, I'm a grown adult, I'M A GROWN ADULT!

  • @iDentityUS
    @iDentityUS Рік тому

    If the trace channel is on visibility then what should the other channels be for enemies whom I’m trying to deal damage to? They are not taking any damage from my line trace I even made my own trace channel and allocated the bullet hit scan to that channel. Then on the enemy I blocked that trace channel on my capsule component and mesh. I’m really confused as to how this works

    • @ArtofficialEntertainment
      @ArtofficialEntertainment  Рік тому

      The trace channel you set in the line trace node needs to be what is set to "block" under the collision settings. So if you have a line trace with a custom channel named "player attack" - whatever enemy you want to damage has to have that trace channel set to "block". Visibility is just a prenamed channel. It's not referencing being able to view the trace. That's what the draw debug drop down is for.

  • @moneyboy709
    @moneyboy709 Рік тому

    When I try to make a line Trace on, Just when I holdind the left mouse butom, give me a back a error, infinity loop detected, do u know why? Tanks for the help, Nice vídeo!!

    • @ArtofficialEntertainment
      @ArtofficialEntertainment  Рік тому +1

      Hard to say why without seeing how you set up the execution. Infinite loops can be caused by a wide variety of things. Id suggest joining the channel discord and sending some screen grabs in the 'help request" section. There's a few other devs in the discord that are reliable also for assistance on other matters

    • @moneyboy709
      @moneyboy709 Рік тому

      @@ArtofficialEntertainment tanks dude,!!

  • @kjdee140
    @kjdee140 Рік тому

    How do you get a line trace to rotate with you in real time. Say, you want it to update as long as you have the input held down, and then stops when you release it?

    • @ArtofficialEntertainment
      @ArtofficialEntertainment  Рік тому

      Use "Set timer by event" and call it off a custom event - Then make another custom event ( with a "Clear and invalidiate timer by handle" and hook the output of the Set timer by event in the Handle input - From there you can use the first custom event off "Pressed" and the second off of released for any of the main event keys - So for example, One custom event named "Start Trace" then hook the execution pin into the set timer by event then just also drag from the red event box into the input on the timer, set it to .01 and make sure "looping is checked - Then a second custom event named "End Trace" this hooked into "Clear and invalidate timer by Handle" and then just connecting the blue output pin of the set timer into the clear and invalidate timer - Then off Keyboard event E: Pressed runs start trace // Release runs end trace.
      I know i typed out a lot for something simple but just wanna make sure i clarify as best as i can on how to do it :)

  • @JohnRiversOfficial
    @JohnRiversOfficial Рік тому +1

    THANK YOOOOOOOUUUUU!

    • @JohnRiversOfficial
      @JohnRiversOfficial Рік тому

      seriously man, this is the holy grail of line trace tuts. thank you very much.