How do I prevent attacks from traveling through walls without deleting them?

How do I…

Mask off my attacks from visually traveling through walls without deleting them entirely.

What is the expected result

One character has a spread-out attack that grows as it travels. The goal is to allow it to widen and hit multiple enemies. When fired down a narrow hallway, the attack should be wider than the hallway but only the portion of the attack not intersecting a wall should continue. The sides of the attack being intersected should not be visibly traveling through the wall. But the unimpeded part should travel through, like the image is cut off.

What is the actual result

The attack visibly travels through the wall. I set it to delete on collision but then the entire attack is deleted if only a mere corner smacks a wall. It does not damage enemies through walls, but since it seemingly travels through them it looks like it should and it confuses players.

Related screenshots

why don’t you make the spread attack an actual spread of many small particles. it would only take a handful of them. and the coding would be easy to do.