Prevention Channel for Box Trace for Objects

In radial damage there’s a setting called Damage Prevention Channel so if there’s an object that blocks it, the damage can’t pass through behind.

I’m using a detection system for pawns with Box Trace For Objects. The system works but it detects the pawns even if they’re behind a wall. How can I prevent the Box Trace from tracing the pawns behind the walls?

Hey @SweptHilt!

The way you would do this is perform a line trace using FOR EACH with each enemy in the box trace, with the start of the line trace being the start of the damage source, and the end being the enemy. Obviously, you want that new line trace to be stopped by things like things on the Static collision channel (like walls). Line traces are EXTREMELY cheap processing-wise, so you can throw them around like crazy without a hit to performance.

Then with that line trace you get True or False, and if False, don’t do damage, and if True, do damage.

Hope that helps! :slight_smile:

Thank you! So as I understand there’s no way to just block the box trace for static objects. I’ll add a line trace at the end of the box trace and the line trace will check if there’s a static object or not.