Enemy Line Trace Going Through Walls To Player

I am trying to setup an enemy for my project, where one of the attacks is a constant laser beam to the player. My problem is that the linetrace works but it doesn’t end the line trace when something is between the enemy and the player. I attached the problem happening in the viewport when I play and where my linetrace is setup in blueprints. Thank you so much.


Found an vid on this.

Basically, your problem is that you didn’t completely fill out the “trace by channel” function. An quick fix is by adding more trace channels to that node if you want it to collide on everything; but you have to be aware of your collision settings for every object that you’re using. Alternatively, you could just create an custom object channel or two and just use those.

But either way, you actually have an lot boxes in your objects’ settings to tick through if you don’t want an laser burning through that wall, your floor, some furniture…

Okay cool thank you. Haven’t completely figured it out yet but I think I’m going in the right direction now.