AI not running all the time

Hello. I’m currently trying to get my AI to run when the player is within a set radius and if not, just randomly roam around my scene. I know that the functions themselves are working, but I have the following issue. Sometimes my AI will not run when I am right next to it and sometimes it will. Equally, if the AI is roaming and the player is in it’s way, it will hit the player rather than run away from the player. Is there any way to solve this? I have attached all the relevant events below:
image
image
image
image

Any more info that you need please let me know!