# How can i make the enemy ai chase and shoot the player?

**URL:** <https://forums.unrealengine.com/t/how-can-i-make-the-enemy-ai-chase-and-shoot-the-player/2704848>\
**Category:** AI\
**Tags:** unreal-engine, question\
**Created:** [March 9, 2026, 9:09pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-enemy-ai-chase-and-shoot-the-player/2704848 "2026-03-09T21:09:04Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![BRGEzedeRocco](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/brgezederocco/32/1216890_2.png) [@BRGEzedeRocco](https://forums.unrealengine.com/u/BRGEzedeRocco)\
**Post date:** [March 10, 2026, 8:59pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-enemy-ai-chase-and-shoot-the-player/2704848/2 "2026-03-10T20:59:53Z")

</div>

Hello @SpiderProwler ,Welcome back to the forums!

I recommend checking a post I made where I show a **basic Behavior Tree setup** in which the enemy AI chases the player, using **AI Perception inside the AI Controller** for detection.

> [@Behavior tree roadblock](https://forums.unrealengine.com/t/behavior-tree-roadblock/2696746):
>
> So, I’m trying to work on implementing behavior trees for the sake of flexibility in my enemy code. I’ve been trying to follow a tutorial, and it was going pretty well, however since I’ve gotten to the part to make it automatically switch states, it…doesn’t work. Instead of chasing the player upon spotting them, it just freezes up. It won’t let me post the video of what is happening, but it looks like it might be doing this thing where upon detecting the player it keeps rapidly trying to refresh…

As I mentioned before, you can achieve this behavior using **AI Perception**.

First, set up **AI Perception (Sight)** in the **AI Controller** so the enemy can detect the player.

Then, in the **Behavior Tree** , you can decide which action to take based on the **distance to the player** :

- If the enemy **sees the player** and the **distance is greater than the attack range** , the enemy should **chase the player**.
- If the enemy **sees the player** and the **distance is within the attack range** , the enemy should **stop and shoot**.

You can implement this by adjusting the **Acceptable Radius** of the **Move To** node in the Behavior Tree.

Also, I’m leaving this tutorial series that explains the whole setup very clearly. In the example they use a **melee attack** , but in your case you would just need to change that part so the enemy **shoots when the player is within attack range**.

https://www.youtube.com/embed/-t3PbGRazKg?feature=oembed&wmode=opaque&list=PLNwKK6OwH7eW1n49TW6-FmiZhqRn97cRy

Let me know if it helps!

---

_[View the full topic](https://forums.unrealengine.com/t/how-can-i-make-the-enemy-ai-chase-and-shoot-the-player/2704848)._
