Using Line of Sight to allow the engine to know when your character should be shot at.
This video will walk you through the concept:
youtu.be/o_CXA7M22aw
You can also have more than one Line of Sight behavior on an enemy - a large one for vision to set aggro - then a smaller one for attack range.