Trying to do it in the blueprint will conflict with the behavior tree. It will generally be better to do it in the behavior tree.
What you’ll want to do is add a few more parallel behaviors, and have entry gates on each of them. Add a property “running away” boolean and a “running away until” time, and then do something like:
- if in running away mode, if “running away until” time is not yet expired, keep running away, else set “running away” to false (which will resume patrolling)
- if not in running away mode, but player within sight radius, then if player is close enough, then set “running away” and “running away time”, else if player is not close enough, then stand still
- if not in running away mode, and not in sight radius, then patrol