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
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
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!
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 :)
@@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.
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..
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.
@@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..*
@@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.
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
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
@@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 :)
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 ?
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.
@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
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
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.
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!!
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
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?
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 :)
I never understood line traces before this video. Everyone wants to teach, but not everyone can teach, you can teach brother, good job!
What a nice tutorial!! It helped me with a completely different problem, but thanks to you I saw how to connect rotation properly, thankssss!
Great Tutorial for Unreal 5, all other tutorials i found were for unreal 4 mostly.. and this was really helpful thanks..
Thank you very much! 😀
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
The custom trace channel tech is soo helpful, thanks for the tutorial!
Very good, concise tutorial. Keep it up, great stuff!
Thank you so much!! And trust me we are just getting started :)
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
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.
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!
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 :)
@@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.
Can you do a tutorial on adding a third person cover system using line traces?
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..
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.
@@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..*
@@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.
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?
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
Do you have to have an end point to the line trace? or can you set infinite distance?
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
@@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 :)
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 ?
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.
@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
32:47 I'm a grown adult, I'm a grown adult, I'M A GROWN ADULT!
Had the same thought myself lmfao
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
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.
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!!
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
@@ArtofficialEntertainment tanks dude,!!
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?
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 :)
THANK YOOOOOOOUUUUU!
seriously man, this is the holy grail of line trace tuts. thank you very much.