# How to make zombie AI?

**URL:** <https://forums.unrealengine.com/t/how-to-make-zombie-ai/285754>\
**Category:** AI\
**Tags:** unreal-engine, question\
**Created:** [June 13, 2014, 2:28am UTC](https://forums.unrealengine.com/t/how-to-make-zombie-ai/285754 "2014-06-13T02:28:43Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![gotgrassct](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gotgrassct/32/734850_2.png) [@gotgrassct](https://forums.unrealengine.com/u/gotgrassct)\
**Post date:** [June 13, 2014, 2:28am UTC](https://forums.unrealengine.com/t/how-to-make-zombie-ai/285754/1 "2014-06-13T02:28:43Z")

</div>

I Have the animations, i just want to make realistic zombie AI. i want the zombie to walk around and look for the player,  
and if the player is in his line of sight i would like him to run towards the player and attack him. How would i do this?

---

<div class="post-metadata">

**Author:** ![Dartanlla](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dartanlla/32/724052_2.png) [@Dartanlla](https://forums.unrealengine.com/u/Dartanlla)\
**Post date:** [June 13, 2014, 5:11am UTC](https://forums.unrealengine.com/t/how-to-make-zombie-ai/285754/2 "2014-06-13T05:11:52Z")

</div>

Using the information found on the following two pages I was able to create a simple zombie style AI in a few hours. I was able to do it all in blueprints.

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

> **[Behavior Tree Tutorial](https://forums.unrealengine.com/showthread.php?130-Behavior-Tree-Tutorial)**
>
> Disclaimer right up front. This isn’t complete, I’ll edit it to fill it out. Also, I’m on a slightly older build of UE4 and I’m not sure what’s changed with today’s version. Edit: In the tread that follows, Epic devs share many things about the UE4...

---

<div class="post-metadata">

**Author:** ![gotgrassct](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gotgrassct/32/734850_2.png) [@gotgrassct](https://forums.unrealengine.com/u/gotgrassct)\
**Post date:** [June 13, 2014, 6:39pm UTC](https://forums.unrealengine.com/t/how-to-make-zombie-ai/285754/3 "2014-06-13T18:39:48Z")

</div>

Thanks, i will give it a shot. But is there anyway u can set me up a simple blueprint example of the zombie following the player and when he gets close he attacks him

---

<div class="post-metadata">

**Author:** ![Dartanlla](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dartanlla/32/724052_2.png) [@Dartanlla](https://forums.unrealengine.com/u/Dartanlla)\
**Post date:** [June 13, 2014, 9:55pm UTC](https://forums.unrealengine.com/t/how-to-make-zombie-ai/285754/4 "2014-06-13T21:55:48Z")

</div>

Here are some screenshots of the blueprints. This AI patrols an area and then follows the player if they get too close. After chasing the player for a certain distance, the AI will stop chasing and return to patrolling around the spawn point.

The behavior tree - This is the brain of the AI

 ![8382-behaviortree1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/f/42fc71dab4d4fc476520f785a1264c294f1174eb.png)

The blackboard data asset - This stores all of the vars that the behavior tree needs

 ![8383-blackboard.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/8/e/88e79be743bb243e95bfa4d64854a8df0ca223c0.png)

---

<div class="post-metadata">

**Author:** ![Dartanlla](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dartanlla/32/724052_2.png) [@Dartanlla](https://forums.unrealengine.com/u/Dartanlla)\
**Post date:** [June 13, 2014, 9:56pm UTC](https://forums.unrealengine.com/t/how-to-make-zombie-ai/285754/5 "2014-06-13T21:56:53Z")

</div>

The Find Enemy service - See if there is an enemy nearby

 ![8387-findenemyservice.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/7/de7cd06aadb19794365e5248c234b5d1c34d0018.png)

The Check Distance from Spawn service - Only chase the player so far and then stop chasing

 ![8388-checkdistancefromspawnservice.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/0/3/8031997bba9a6f3a182e4969964e4ac00a9d5723.png)

---

<div class="post-metadata">

**Author:** ![Dartanlla](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dartanlla/32/724052_2.png) [@Dartanlla](https://forums.unrealengine.com/u/Dartanlla)\
**Post date:** [June 13, 2014, 9:57pm UTC](https://forums.unrealengine.com/t/how-to-make-zombie-ai/285754/6 "2014-06-13T21:57:11Z")

</div>

Find Random Point task - When patrolling this finds a random point nearby to move to

 ![8390-findrandompointtask.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/3/5/e355c216513f4c886a76bc721bedd89b510f62d3.png)

---

<div class="post-metadata">

**Author:** ![gotgrassct](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gotgrassct/32/734850_2.png) [@gotgrassct](https://forums.unrealengine.com/u/gotgrassct)\
**Post date:** [June 15, 2014, 12:56am UTC](https://forums.unrealengine.com/t/how-to-make-zombie-ai/285754/7 "2014-06-15T00:56:19Z")

</div>

I Set it up the zombies to just wander around, but they walk really fast, faster than i can sprint, is there a way to change their speed? and are the Find Enemy services and all the other ones u provided to me are seperate blueprints or is it all in one?

---

<div class="post-metadata">

**Author:** ![Dartanlla](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dartanlla/32/724052_2.png) [@Dartanlla](https://forums.unrealengine.com/u/Dartanlla)\
**Post date:** [June 15, 2014, 2:41am UTC](https://forums.unrealengine.com/t/how-to-make-zombie-ai/285754/8 "2014-06-15T02:41:33Z")

</div>

You can set the enemy walk speed in your Character Defaults for the enemy. I changed it from 600 (the default) to 150 to create a nice slow walk. Each one of the images above is a separate blueprint. The first two derive from BTService\_BlueprintBase and the Find Random Point Task derives from BTTask\_BlueprintBase.

---

<div class="post-metadata">

**Author:** ![Psilowin\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Psilowin\_1](https://forums.unrealengine.com/u/Psilowin_1)\
**Post date:** [June 15, 2014, 2:56am UTC](https://forums.unrealengine.com/t/how-to-make-zombie-ai/285754/9 "2014-06-15T02:56:58Z")

</div>

Also, feel free to check out this open-sourced project ! [Unreal Engine 4 - Zombie Camp - Game Development - Epic Developer Community Forums](https://forums.unrealengine.com/showthread.php?8996-Unreal-Engine-4-Zombie-Camp)

---

<div class="post-metadata">

**Author:** ![SpaceHunterZ\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SpaceHunterZ\_1](https://forums.unrealengine.com/u/SpaceHunterZ_1)\
**Post date:** [November 6, 2014, 2:53pm UTC](https://forums.unrealengine.com/t/how-to-make-zombie-ai/285754/10 "2014-11-06T14:53:22Z")

</div>

the blackboard key ‘‘Enemy’’ come from where? and how i make its a pawn. Cause when i try to make the Find Random points or check distance blueprints, I cant make the Cast to Enemy1. I have the Blackboard with two key the target and the target point, i made the blueprint find enemy service with the struct (BlackBoardKeySelector) i nammed its enemy. I made the behavior tree without all the blueprints done.

---

<div class="post-metadata">

**Author:** ![Bomtaker\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bomtaker\_1](https://forums.unrealengine.com/u/Bomtaker_1)\
**Post date:** [January 20, 2015, 11:38am UTC](https://forums.unrealengine.com/t/how-to-make-zombie-ai/285754/11 "2015-01-20T11:38:36Z")

</div>

Hi I am having to do a project similar to this one and have something very similar set up but i was wondering if there is a way to change the Ai speed when they see the player? sort of like a see player = run style thing, i have a basic blueprint set up so that it will set a Boolean to true when it sees the player but i cant get it to change the Actors speed after searching for hours, could you provide any insight?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_90cbf493](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_90cbf493](https://forums.unrealengine.com/u/anonymous_user_90cbf493)\
**Post date:** [March 31, 2015, 2:46am UTC](https://forums.unrealengine.com/t/how-to-make-zombie-ai/285754/12 "2015-03-31T02:46:04Z")

</div>

you can set an invisible bubble around ur champion and when it colide with enemy pawns to set they speed to more…
