# How do i make an enemy follow the player?

**URL:** <https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953>\
**Category:** Uncategorized\
**Created:** [October 27, 2020, 8:21pm UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953 "2020-10-27T20:21:08Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr\_Secret](https://community.flowlab.io/user_avatar/community.flowlab.io/mr_secret/32/2214_2.png) [@Mr\_Secret](https://community.flowlab.io/u/Mr_Secret)\
**Post date:** [October 27, 2020, 8:21pm UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953/1 "2020-10-27T20:21:08Z")

</div>

Pls help me i really need it

---

<div class="post-metadata">

**Author:** ![AbstractGallery](https://community.flowlab.io/user_avatar/community.flowlab.io/abstractgallery/32/43148_2.png) [@AbstractGallery](https://community.flowlab.io/u/AbstractGallery)\
**Post date:** [October 27, 2020, 9:15pm UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953/2 "2020-10-27T21:15:16Z")

</div>

Here’s a link to grazer’s example

> **[Flowlab.io - Chase Example](https://flowlab.io/game/play/2111)**
>
> Use the arrow keys to move, and the enemy will chase.
> 
> The enemy compares it own \*\*x\*\* and \*\*y\*\* position to the \*\*x\*\* and \*\*y\*\* position of the player, and uses the result to choose a direction.

---

<div class="post-metadata">

**Author:** ![ca13098](https://community.flowlab.io/user_avatar/community.flowlab.io/ca13098/32/9315_2.png) [@ca13098](https://community.flowlab.io/u/ca13098)\
**Post date:** [June 9, 2021, 4:02pm UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953/3 "2021-06-09T16:02:28Z")

</div>

Ok and why real ❤ ❤ ❤ ❤ ❤ ❤ ❤

---

<div class="post-metadata">

**Author:** ![hihilogic](https://community.flowlab.io/user_avatar/community.flowlab.io/hihilogic/32/64899_2.png) [@hihilogic](https://community.flowlab.io/u/hihilogic)\
**Post date:** [June 9, 2021, 5:05pm UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953/4 "2021-06-09T17:05:58Z")

</div>

Dude. Don’t post on dead topics FOR NO REASON!!!

---

<div class="post-metadata">

**Author:** ![Duykk](https://community.flowlab.io/user_avatar/community.flowlab.io/duykk/32/12800_2.png) [@Duykk](https://community.flowlab.io/u/Duykk)\
**Post date:** [November 10, 2021, 12:00am UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953/5 "2021-11-10T00:00:16Z")

</div>

im sorry for messaging on this but its not working for me and i dont know why  
even tho it was working before i just dont know why

---

<div class="post-metadata">

**Author:** ![AbstractGallery](https://community.flowlab.io/user_avatar/community.flowlab.io/abstractgallery/32/43148_2.png) [@AbstractGallery](https://community.flowlab.io/u/AbstractGallery)\
**Post date:** [November 10, 2021, 12:25am UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953/6 "2021-11-10T00:25:48Z")

</div>

You probably shouldn’t revive dead topics, this one was from over a year ago, instead you should create your own, new, topic.

But, since you already revived it, I can try to help. Can I have a link to your game so I can check it out?

---

<div class="post-metadata">

**Author:** ![Duykk](https://community.flowlab.io/user_avatar/community.flowlab.io/duykk/32/12800_2.png) [@Duykk](https://community.flowlab.io/u/Duykk)\
**Post date:** [November 10, 2021, 2:07am UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953/7 "2021-11-10T02:07:06Z")

</div>

sorry about that but here it is anyway

> **[Flowlab.io - The Great Sandwich (WIP)](https://flowlab.io/game/play/1849287)**
>
> Built with flowlab.io

i have purple knights that are supposed to follow you but its not working

(also sorry for reviving it i wasnt sure if i should)

---

<div class="post-metadata">

**Author:** ![AbstractGallery](https://community.flowlab.io/user_avatar/community.flowlab.io/abstractgallery/32/43148_2.png) [@AbstractGallery](https://community.flowlab.io/u/AbstractGallery)\
**Post date:** [November 11, 2021, 1:42pm UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953/8 "2021-11-11T13:42:50Z")

</div>

Ok, so I took a look at your game, it looks like the proximity behavior isn’t selected to an object, all you have to do is go into the purple knight’s behavior click on the proximity behavior, and select “player” so it knows when the player gets close it will know to follow the player.

This is inside of the Purple Knights behavior, what you should be changing.

 ![Untitled](https://community.flowlab.io/uploads/default/original/2X/0/0959b5b8fc6997b2f3901c129a7361ab5d9e12f1.png)

---

<div class="post-metadata">

**Author:** ![AbstractGallery](https://community.flowlab.io/user_avatar/community.flowlab.io/abstractgallery/32/43148_2.png) [@AbstractGallery](https://community.flowlab.io/u/AbstractGallery)\
**Post date:** [November 11, 2021, 1:43pm UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953/9 "2021-11-11T13:43:19Z")

</div>

Also, are the knights supposed to be invisable???

---

<div class="post-metadata">

**Author:** ![Duykk](https://community.flowlab.io/user_avatar/community.flowlab.io/duykk/32/12800_2.png) [@Duykk](https://community.flowlab.io/u/Duykk)\
**Post date:** [November 11, 2021, 3:09pm UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953/10 "2021-11-11T15:09:48Z")

</div>

no id dont know why its not working like that maybe im notlooking enough?

---

<div class="post-metadata">

**Author:** ![Duykk](https://community.flowlab.io/user_avatar/community.flowlab.io/duykk/32/12800_2.png) [@Duykk](https://community.flowlab.io/u/Duykk)\
**Post date:** [November 11, 2021, 3:13pm UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953/11 "2021-11-11T15:13:19Z")

</div>

nevermind i found the problem with it thanks for even helping me on this old dead topic

appreciate it!

🙂

---

<div class="post-metadata">

**Author:** ![AbstractGallery](https://community.flowlab.io/user_avatar/community.flowlab.io/abstractgallery/32/43148_2.png) [@AbstractGallery](https://community.flowlab.io/u/AbstractGallery)\
**Post date:** [November 11, 2021, 3:24pm UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953/12 "2021-11-11T15:24:14Z")

</div>

Yeah, no problem, just remember it’s better to create a new topic instead of bringing up dead ones, even if it’s about the thing.

---

<div class="post-metadata">

**Author:** ![Duykk](https://community.flowlab.io/user_avatar/community.flowlab.io/duykk/32/12800_2.png) [@Duykk](https://community.flowlab.io/u/Duykk)\
**Post date:** [November 11, 2021, 3:33pm UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953/13 "2021-11-11T15:33:17Z")

</div>

yea sorry about that

---

<div class="post-metadata">

**Author:** ![walker123456789](https://community.flowlab.io/letter_avatar_proxy/v4/letter/w/85f322/32.png) [@walker123456789](https://community.flowlab.io/u/walker123456789)\
**Post date:** [June 25, 2024, 9:11pm UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953/14 "2024-06-25T21:11:39Z")

</div>

Can I get some help on my game plz. I need the enemy to attack the player and for the enemy to move on by itself. [https://flowlab.io/games/play/2576087](https://flowlab.io/games/play/2576087) it’s a different type of 2D

---

<div class="post-metadata">

**Author:** ![DJTheWhat](https://community.flowlab.io/user_avatar/community.flowlab.io/djthewhat/32/70263_2.png) [@DJTheWhat](https://community.flowlab.io/u/DJTheWhat)\
**Post date:** [June 25, 2024, 9:38pm UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953/15 "2024-06-25T21:38:52Z")

</div>

Hi, please don’t revive topics, it clogs up the forums from the new topics. Please make a new topic instead.

---

<div class="post-metadata">

**Author:** ![walker123456789](https://community.flowlab.io/letter_avatar_proxy/v4/letter/w/85f322/32.png) [@walker123456789](https://community.flowlab.io/u/walker123456789)\
**Post date:** [July 22, 2024, 11:12pm UTC](https://community.flowlab.io/t/how-do-i-make-an-enemy-follow-the-player/27953/17 "2024-07-22T23:12:49Z")

</div>

): ok I will try sorry for cloging up the forums
