# AI stalk bar that fills when in sight/patrol around the player

**URL:** <https://forums.unrealengine.com/t/ai-stalk-bar-that-fills-when-in-sight-patrol-around-the-player/451717>\
**Category:** AI\
**Tags:** ai-navigation, sight, unreal-engine, question\
**Created:** [July 4, 2019, 6:32pm UTC](https://forums.unrealengine.com/t/ai-stalk-bar-that-fills-when-in-sight-patrol-around-the-player/451717 "2019-07-04T18:32:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Na1den](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Na1den](https://forums.unrealengine.com/u/Na1den)\
**Post date:** [July 4, 2019, 6:32pm UTC](https://forums.unrealengine.com/t/ai-stalk-bar-that-fills-when-in-sight-patrol-around-the-player/451717/1 "2019-07-04T18:32:20Z")

</div>

Hey guys. My question is if anyone knows how to implement a way for an AI character to build up something over sight and when its finished it fires an event.  
For example a bar that fills up whenever the AI character sees the player or a timer that depletes whenever the Ai sees the player. And when it reaches 100% it fires an external event. Does anyone know how to implement that in an efficient and resource-friendly way?

While I’m at it I would also like to ask if there is a way to set the AI to “patrol/move to” in a certain area around the player, like a trigger box that is attached to the character and the Ai can only choose a location inside that trigger box?
