# 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:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SpiderProwler](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SpiderProwler](https://forums.unrealengine.com/u/SpiderProwler)\
**Post date:** [March 9, 2026, 9:09pm UTC](https://forums.unrealengine.com/t/how-can-i-make-the-enemy-ai-chase-and-shoot-the-player/2704848/1 "2026-03-09T21:09:05Z")

</div>

I have set up an enemy AI in unreal engine 5.3 using behavior tree, blackboard and AI controller. I want that when the Enemy sees the player he will be either able to shoot at him or to chase him depending from the distance.

 ![Screenshot 2026-03-09 221048](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/4/d/44d2adffa64a6ca63f7f8990ef0614745836087f.png)

 ![Screenshot 2026-03-09 221038](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/9/e/69eab5f8d065fe9d363416ff004070be2aa6a7aa.png)

 ![Screenshot 2026-03-09 220838](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/2/a/a2a1e5207b31a67db5b9aac298780e84439660e4.png)

 ![Screenshot 2026-03-09 220823](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/4/794ec0bdcb4ee1b6729f1fbe027d0da30593751b.png)

the first two photos regard the task for chasing, the third is the blackboard, and the last is my BT set up. I don’t know if and where i should add decorators for this or if should just integrate the shooting part with the task for chasing. Can someone help me, please?

---

<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!

---

<div class="post-metadata">

**Author:** ![SpiderProwler](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SpiderProwler](https://forums.unrealengine.com/u/SpiderProwler)\
**Post date:** [April 4, 2026, 9:17am UTC](https://forums.unrealengine.com/t/how-can-i-make-the-enemy-ai-chase-and-shoot-the-player/2704848/3 "2026-04-04T09:17:52Z")

</div>

Hi there! Thank you for your reply! 🙂

I am trying to follow his tutorials , the ones you provided me but i still run in some problems i’ll show you down below.

1# EQS query not running properly

So i’ve set up an EQS query in order to make the enemy stop within a certain range around the player to shoot him right?

This is the behavior tree set up. In the “Run EQS query” node i’ve tried to define the “result blackboard key” value with a BB value called “PointOfInterest” and was returning invalid.

 ![Screenshot 2026-04-04 110937](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/9/1/f910e2a792bff7d54b3ae02f25943ee68be98046.png)

 ![Screenshot 2026-04-04 111702](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/2/0/320d2cc490ea813a06e4f7a6a290e8e1afdf0736.png)

 ![Screenshot 2026-04-04 111710](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/3/5/1354c5b13a9000d8403d1eb905b86b4983e9f90b.png)So i’ve tried to define it in the AI\_controller event graph. (the two images up here) The result?Down here

 ![Screenshot 2026-04-04 112323](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/b/01b78781425e0c8da6d6b5be653f60895d3d9c17.jpeg)

 ![Screenshot 2026-04-04 112404](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/c/b/4cba2097508740f3edb88f440def72573e2d17db.png)

The “PointOfInterest” still returns invalid and the behavior tree won’t go to the “Move to PointOfInterest” task . What do you think about it? Got any tips and suggestions?
