i have an enemy moving from one side to the other i want him to stop then attack when in range but when not in range continue to move. this applies to melee and ranged characters
i was not able to find any tutorials, wish forge had a great tutorial for advance enemy Ai but the enemy would just move and shoot at the same time which is not what i wanted
if you could help i would be grateful Thanks
That may depend on what you use to move the enemy. If you use the platformer behaviour, you can:
-store the speed and direction in some variables
-change to maximum speed to 0 in order to stop it, then when the player is out of range,
-change maximum speed to the previous one
-add back the previous direction of movement
The same principle works with built-in forces. Just use “Stop the object” instead of changing the max speed.
thanks i ended up doing this, the way you suggested is probably better. For your way do you add the movement via force or is there another way to start a movement?