LineTrace Question

Hi all,

I’ve got a line trace (trace channel) running every 0.1 second to check if the player is looking at Object A,B and so on. At the moment i don’t check if there’s a wall between the player and the object (Fig1).
I changed the walls collision layer so the ray hits the wall (Fig2) and the linetrace returns a hit (true) and the wall Actor.

My question is, is it possible to “kill” a trace by a certain object/channel so the ray hits the wall but returns false because I only want to ‘receive’ the Objects and not the blocking walls?! (Fig3) Or do I have to do another test to filter the wall? :confused:

Yes it is possible

Everything you need to know about tracing straight from epic themselves

MultiLineTrace will return an array of “hits” that happen between trace start and trace end. You can manually filter the results from the hitresult array and act upon them as you wish.