How do I make a line trace STOP AND DON T HIT MY CHARACTER when it hits my shield

i ve noticed something now, the line trace by channel hits my shield, do i need to add an ignore actor ?


It also doesn t print out the green anymore
Client 1 is me
image_2023-03-12_160150101

so it s also registering my character s mesh?
image_2023-03-12_160731634

so i got it to kind of work but it only hits it sometimes
image_2023-03-12_161120836

ok im not understanding you correctly i dont think

The trace should hit the first object it finds which is you character
it should then (if set to block as it should) not hit again unless you trace again

the trace should have a component like i shown you, check if it matches shield, if true do nothing or code to say it hit shield. otherwise do damage

maybe you are targeteing different areas? how are you aiming the trace?

by visibility

ok but where is the end point? turn on the debug line trace to see where the line hits

oh, it s basically at the end of my sword

the end point not the start, or is it a collision sphere?

it s more of a socket on my sword

ok i think you are tracing wrong

tracing works by drawing a line in the direction you are facing, from you to a point in space

so you need to draw “from sword” to an area X amount ahead of your sword

idk, i just followed a tutorial on the sword part but it looked good to me, basically the sword was the trace, you touch something with the end of you sword and it does the action, but now i see that the trace will go through that something

something like this

if using the sword tip, you need to use a collision, not a trace , a small collision sphere at the tip of the sword, and check it to raise hit events on overlap

traces are usually for projectiles but can be used in this case but its not usually how its done

i didn t know

yeah, make sense

so how would i do this, do i like go in the sword bp and add a collision on the tip?

to keep with the trace you want to draw a trace FROM the tip of the sword to say a meter in front

you do that by multiplying the forward vector by say 100 add that to your player location.

this should draw a trace about a meter straight forward if that works then play lowering the “100” value to get a more accurate test from closer

1 Like