Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Troubles with DrawDebugLine function


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

[1]: /storage/temp/69212-1.png

Product Version: UE 4.10
1.png (44.3 kB)
more ▼

asked Dec 03 '15 at 06:38 PM in C++ Programming

avatar image

127 39 37 51

avatar image gedamial Dec 03 '15 at 06:41 PM

This is the Trace function after the DrawDebugLine function:

alt text

3.png (31.1 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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?

more ▼

answered Dec 03 '15 at 09:45 PM

avatar image gedamial Dec 03 '15 at 09:51 PM

Great! I was so stupid :P

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

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

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

1.png (30.9 kB)
avatar image Matthew J Dec 03 '15 at 10:23 PM

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).

avatar image gedamial Dec 04 '15 at 01:25 PM


I tried setting ECC_Visibility as function parameter.

Then, I set "OVERLAP" to both Camera and Visibility alt text

But nothing happens :/

1.png (29.9 kB)
avatar image Matthew J Dec 04 '15 at 03:10 PM

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.

avatar image gedamial Dec 04 '15 at 03:26 PM

Ok solved the issue. Thanks =)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question