# Enemies Firing at Player Through Walls

**URL:** <https://forums.unrealengine.com/t/enemies-firing-at-player-through-walls/468565>\
**Category:** Community & Industry Discussion\
**Tags:** shooting, fire, bullet, unreal-engine, enemy, player, question\
**Created:** [July 23, 2020, 12:53pm UTC](https://forums.unrealengine.com/t/enemies-firing-at-player-through-walls/468565 "2020-07-23T12:53:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_0f6583e9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0f6583e9](https://forums.unrealengine.com/u/anonymous_user_0f6583e9)\
**Post date:** [July 23, 2020, 12:53pm UTC](https://forums.unrealengine.com/t/enemies-firing-at-player-through-walls/468565/1 "2020-07-23T12:53:02Z")

</div>

I’m having an issue with enemies shooting at my player through the walls. The projectiles don’t go through the walls to injure the player, but they still ‘fire’ when the player enters the box collision through the wall.

Is there a way to make it so the enemies can’t actually see the player through a wall? Even if the player enters the box volumes. I have 2 collision volumes set up, one for the enemy to start following the player, and the other is set for the enemy to fire when the player enters.

 ![307900-shooting-through-walls.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/b/f/9bff04361a5001240a2b0d869873391d6e9c5d74.png)

 ![307921-shooting-through-walls-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/c/e/cce428de7cddbfa632b424efeac89ce953487db7.png)

---

<div class="post-metadata">

**Author:** ![Crispy\_Penguin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crispy\_Penguin](https://forums.unrealengine.com/u/Crispy_Penguin)\
**Post date:** [July 23, 2020, 2:16pm UTC](https://forums.unrealengine.com/t/enemies-firing-at-player-through-walls/468565/2 "2020-07-23T14:16:57Z")

</div>

I would recommend doing a `TraceSphereByChannel` from Enemy character to Target Character (Player) before attempting to fire. If the first hit is player, go ahead with attempting to fire, but if it is a wall, do not fire.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0f6583e9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0f6583e9](https://forums.unrealengine.com/u/anonymous_user_0f6583e9)\
**Post date:** [July 23, 2020, 7:22pm UTC](https://forums.unrealengine.com/t/enemies-firing-at-player-through-walls/468565/3 "2020-07-23T19:22:05Z")

</div>

Thank you :), I got it working with one of the Sphere Trace By Channel nodes. As usual it’s was a fairly simple solution – like it usually is lol.
