Make the IA move to the closest "safe zone"

I looking for a way to make my IA run to a “safe zone” when they saw a ennemy
But they will be more than 5 safe zone on the map so i need to make the IA run to the closest safe zone
Thank you for your attention ^^

Think about what do you mean with “closest” safe zone and how a safe zone is defined. I mean, do you want the safe zone that has the closest center to the AI, or the just the closest vertex? Is the safe zone defined by a set of vertexs? Once you have defined the problem it will be much easier to figure out a solution

Hey Cyadic,

Take a look at EQS doc:

You could make an EQS that searches for all save zones in radius and then do a distance check for the closest one.

Hope this helps :slight_smile:

Thank you Elias that was exaclty what I was looking for ^^
That will definitely help me