Simple line trace by channel not working UE 5.3

I’m trying to set up a simple system for player to select items using the mouse. For some reason Line Trace By Channel isn’t hitting any of the actors I need it to hit. Some are meshes, and some are paper sprites, but none of them work.

You can see the collision settings I’m using for the actors in the second screenshot. I must be missing something.

Any help would be greatly appreciated.


1 Like

I see you’re assuming you’ve hit a BP_Block. Maybe use a print string to find out what the actor actually is :slight_smile:

Thanks for the response! Yes, I’ve tried that, and the problem is I’m not hitting any of the actors I want at all - I’m just hitting the sprite I have behind the actors as a background.

I want to hit the boxy-looking things there, but when I click them the trace goes right through them and hits the background.


Ok. I notice you’re tracing directly out of the camera. How do you align the camera with the objects you want to trace to? ( It looks like a kind of fixed side-scroller cam ).

That is right, it is a side-scroller type thing. The camera setup looks like this. And it’s an orthographic camera. Could this be the issue?

1 Like

I’m guessing it could be. You only have a line directly from the camera to the background, unless the camera happens to be exactly in front of something else.

Using the debug option would let you see where the trace is actually going.

In the long run, if you want to point at something with the mouse and trace to that, you need to project the mouse into world space.

1 Like

Ahhh, I see! So embarrassing! I should be using the mouse coordinates.

1 Like

Thank you very much for talking me through this!

1 Like

Do you need some more pointers?

1 Like

I’ll see if I can figure it out first. I think I saw some relevant tutorials on YT. Thanks again!

1 Like

Try enabling the “Simulation” and live debugging it. I’ve never casted to an object on a line trace before.

Thanks for the suggestion. I’ve got it working already. Was line tracing from the wrong starting point - dumb mistake on my part. Casting from a line trace works just fine.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.