sword trace, problem with axis

i want to set tracers on my sword to detect hits. the first one works fine but if i want the second one to be 20px higher on the blade it doesnt work. i think it has something to do that i try to add 20 to the X vector and he’s taking the X axis from the world and not from the sword itself.

how do i fix this problem? any ideas?


I think it is better to not using trace to detect hits. Why? because it is slower to perform than collision shapes.
Use a regular box collision object to wrap around your sword and let the collision do hit detection.
(you can use multiple box as well if you want damage difference.)

To be honest i took the trace because i thought it drains less performance than collision shapes. Can i turn the collision shape to off if im not making my attack animation? Otherwise it would permanently check for collisions what also drains alot of performance right?

Im not really sure about this collision thing. I tried to run several times trough a sword with collision and sometimes he doesnt respond. Btw, how do i ignore the player which is wearing the sword because netcode and so on. :stuck_out_tongue:

So far i had much better results using traces instead of collision shapes, in fact i had a much better detection with traces…Im doing about 13 Traces along my sword blade and the perfomance hit is null, ( im also interpolating the location, check the location before current and previous frame and make a trace in-between to avoid missing spaces and i use only 2 sockets for the traces with math )

To ignore the player wearing the sword before applying damage / whatever action you want , check that the hit actor isnt the weapon owner

alvarofer so if your system works, could you tell me where i got the failure with the location? Did you used several single line tracers or multi line?