Make distance between enemy and character

Hallo Guys, have made an interesting AI system, but I did not succeed to make distance between enemy and character when enemy fire!
someone has an idea of ​​how to do it?

Well, I honestly don’t know what kind of answer you expect with such little information. Are you using BehaviorTrees? EQS? How is your Attack currently implemented? How the agent determines its next location?

The general idea would be to however, to prefer target locations with a larger distance to the Player over closer one. If you are not using the EQS system, I suggest you to have a look into it, as it would be really useful in this situation.

EQS:
https://docs.unrealengine.com/latest/INT/Engine/AI/EnvironmentQuerySystem/

I used behaviortree but this EQS is interesting, I will study it for good

thanks!