Blue slime wont stop following?

Hello! I was following a youtube tutorial on how to make a following + wandering enemy, and i thought i got it to work. The enemy; blue slime in this case, wanders when in far proximity from the player but when the player comes close it begins to follow the player, however when the player is out of proximity the slime is supposed to begin to wander again. The slime i have in my game can follow but can not stop following the player even when out of proximity.

It would be greatly appreciated if you could look at the code and help me understand how to fix the problem!

1 Like

The Tutorial doesnt stop the Slime from following you; but if you want it to resume wandering after leaving its proximity, you can use a NOR gate.

The Wander Message would send to turn off Follow and Turn back on the Wandering Code.

PS. your forward direction of the slime is to the left, so thats why it looks like its walking backwards. You need to swap All the Flip and Back inputs if you do change the Forward to the Right. The easiest thing to do is to actually flip the art instead.

Also your Follow code doesnt work because you need the “Get” input for the Player X Global.
Also Also the Player X Global needs to go into “B” of the expression



THANK YOU SO MUCH, your explanation is extremely detailed and helped me immensely i can not thank you enough!!
I hope you are having a fantastic day!!!