Enemy moving when player at certain distance

Hi all. I’m trying to move an enemy when player come to certain distance and move on after that.

I tried distance between two objects option. It is work when you come to the certain distance but enemy stops moving after they left the distance.

I tried used to Variables with “between two objects option”. Ok the enemy keep moving when they left the distance but it effects every same enemy object even if they not at the distance.

Shorty this is what i want. For example. When player close to 300pxl to an enemy, it should move to the certain direction and keep moving after it left the distance.

It would be great if you know and explain how to do it.

Thank you so much.

You could add an object variable to the enemy to let it know it has been activated. If the player is at certain distance activate the enemy and then, if the enemy is active, move it:

[code]Conditions: Distance between Enemy and Player is below 300
Actions: Do = 1 to the variable “active” of Enemy

Conditions: Variable “active” of Enemy is = 1
Actions: Move Enemy[/code]

@ Lizard-13
Thank you so much, it works. You saved my day :slight_smile: