Troubles with DrawDebugLine function

Hello.

I have this code in order to draw a debug line using the DrawDebugLine function:
[deleted]

The problem is that anything I hit in the editor, the debug message tells me that I’ve hit myself:

In the StartPlug I added +60 to the PlayerLocation.Z in order to “fit” the raycats with the camera and not with the exact center of the body.

Help me please

This is the Trace function after the DrawDebugLine function:

Great! I was so stupid :stuck_out_tongue:

Another thing, I have a Pickup that has the collision settings like this:

69226-1.png

As I expected, when the DebugLine hits the Pickup it pierces.

How to make the Pickup to be hit by the line?

Hello gedamial,

I’ll look at this for you and give your exact code a try real quick. I did notice something from just looking however. You’re passing a nullptr in for the 2nd argument for the Trace function which you could set to “this” instead so that it ignores the character. Have you tried that?

Pass a ECollisionChannel variable into the Trace function that is set to the same channel that the Pickup is set to “Overlap” or “Block”. In this case, the pickup is set to ignore both so no traces will ever pick it up.

You’ll need to either set Visibility or Camera to Overlap (if you want the trace to pick it up, but still be able to see through it) or Block (if you want the line trace to stop at it).

@

I tried setting ECC_Visibility as function parameter.

Then, I set “OVERLAP” to both Camera and Visibility

69286-1.png

But nothing happens :confused:

I apologize, I should’ve tested it before suggesting it. It doesn’t seem like the overlap responses work for line traces. You’ll want to use the Block setting. It’ll still go through the pickup but if you’re using LineTraceSingleByChannel it’ll only pick up one entry anyway. If you want to hit multiple things, you would need to use a multi line trace.

Ok solved the issue. Thanks =)