Enemies running away from the player

Hi, seeing this suggestion from a YouTube video I would like to understand if it was possible to replicate it using pathfinding


I would like the enemies when the player approaches them to run away and start circling them again

What does it do at the moment?

BTW, you’ll need to stop the pathfinding movement if you apply a Move action in the enemies. Otherwise the two will fight and make for ugly enemy movement.

Also, here’s a video about this type of movement. The vlogger is using Unity, but the principles can be applied to GDevelop with a bit of work.

this is what I used previously and I would have liked to create this way for the enemy to escape when the player approached them.

at the moment what happens is that the enemy runs away in the opposite direction without ever stopping… I imagine the problem is because he doesn’t have a fixed point where to stop

I’ve just had another look at your post first screen shot and I think you’ve made a mistake with this action:

The enemy is moving to a position, but the position x and y values are both set to the angle between player and enemy.

Yeah I know that the mistake Is in that code, I was trying to make a pathfinding movement imitating the First code but I don’t know how.