Line trace on sword

i want to set tracers on my sword to detect hits but it just works in one direction if i place the BP on the hand socket its like in the picture below. i think it has something to do that he takes the X, Y, Z axis from the world and not from the actor? how to solve this problem? any ideas?

Hello, MajekPL!

First things first, it looks like your Line Trace is set to the Visibility channel, which means that it’ll collide with the first Visible object it runs into. The first visible object that that line trace is likely to run into… is its wielder’s hand. There are a couple of ways to fix that.

  1. You could create a new Trace Channel (by going to Edit->Project Settings->Engine->Collision->Trace Channels) that only includes the sword can cut. After creating the channel, you can take any actor that *shouldn’t *be cut by the sword (such as the swordswoman) and set that Trace Channel to ‘Ignore’ in its ‘Details’ panel.
  2. You could instead set the swordswoman under the ‘Actors to Ignore’ array in the Single Line Trace node.

Regards,

Jonathan

Thanks, was asking myself this question also, it always collided with my character if i walk. But how do i set a trace that is related to the sword itself? it always changes his position if im moving, its not fixed on the sword.

help please help!

If you’re using the Location and Rotation of the sword, which it looks like you are in the blueprint, it should follow the sword. If you turn on the ‘Draw Debug’ setting, it should show you where the line trace is happening and that should help you find out what’s wrong.

Yes, its what i did. The red lines on the picture above are the debug lines. My axis is turned so the tracers go from leftside to right side instead of from botton to top. i want to increase the reliability with more tracers. One line from botton to top works fine but if i want one on the begin of the blade to turn right and the next 20pixel above to turn right and so on it doesnt work because the increase of the Y axis is somehow on the world axis and not sword axis.

TL;DR it should be like in the picture:
is this even the right way to do it? what about collisionboxes on a sword how reliable are they ?

Ah, I understand now. I see that you used Get Forward Vector to find the direction that the sword was pointing. If you try Get Up Vector or Get Right Vector, it should get you the tracers you want. Is that not correct?

Collision boxes are pretty reliable in my experience, and they’re the more ‘standard’ way to find out if two objects are colliding. I’d give it a try, especially if the tracers continue to be troublesome.