# AI perception how to check if actor is still in line of sight?

**URL:** <https://forums.unrealengine.com/t/ai-perception-how-to-check-if-actor-is-still-in-line-of-sight/486202>\
**Category:** AI\
**Tags:** Perception, perception-component, unreal-engine, question\
**Created:** [July 14, 2021, 5:22pm UTC](https://forums.unrealengine.com/t/ai-perception-how-to-check-if-actor-is-still-in-line-of-sight/486202 "2021-07-14T17:22:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ares\_514](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ares\_514](https://forums.unrealengine.com/u/ares_514)\
**Post date:** [July 14, 2021, 5:22pm UTC](https://forums.unrealengine.com/t/ai-perception-how-to-check-if-actor-is-still-in-line-of-sight/486202/1 "2021-07-14T17:22:51Z")

</div>

as the title said how can i check if the actor detected is still in line of sight i tried using a retrigrable delay set to the max age i thaught that the perception is updated every tick or something like this but it dosent any idea on how to fix it im using it for the behaiviour tree

---

<div class="post-metadata">

**Author:** ![chrudimer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrudimer/32/918651_2.png) [@chrudimer](https://forums.unrealengine.com/u/chrudimer)\
**Post date:** [July 14, 2021, 7:46pm UTC](https://forums.unrealengine.com/t/ai-perception-how-to-check-if-actor-is-still-in-line-of-sight/486202/2 "2021-07-14T19:46:52Z")

</div>

Hi,

> AI perception how to check if actor is  
> still in line of sight?

GetActorsPerception → break Info → LastSensedStimuli use index of your sight config → check SuccessfullySensed being true.

* * *

> i thaught that the perception is  
> updated every tick or something like  
> this

Sight sense gets updated constantly (may update slower if you use it too much), the others are one shot events. Of course OnTargetPerceptionUpdated and OnPerceptionUpdated only execute on updates, so when you get new stimuli or existing stimuli expire (e. g. hearing due to age or sight due to out of sight).

---

<div class="post-metadata">

**Author:** ![ares\_514](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ares\_514](https://forums.unrealengine.com/u/ares_514)\
**Post date:** [July 14, 2021, 9:02pm UTC](https://forums.unrealengine.com/t/ai-perception-how-to-check-if-actor-is-still-in-line-of-sight/486202/3 "2021-07-14T21:02:56Z")

</div>

can you elaborate more?  
im using OnTargetPerceptionUpdated what should i use instead?  
im still learning  
and thank you for your time

---

<div class="post-metadata">

**Author:** ![chrudimer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrudimer/32/918651_2.png) [@chrudimer](https://forums.unrealengine.com/u/chrudimer)\
**Post date:** [July 15, 2021, 1:48pm UTC](https://forums.unrealengine.com/t/ai-perception-how-to-check-if-actor-is-still-in-line-of-sight/486202/4 "2021-07-15T13:48:42Z")

</div>

> im using OnTargetPerceptionUpdated

Thats fine.

If you want to know whether a certain Actor is currently perceived by the sight sense, you can use this

 ![344143-annotation-2021-07-15.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/0/f/90f58362813479823889983a3e73c39041f1e3b1.jpeg)

Also for sight sense OnTargetPerceptionUpdated will execute everytime it starts seeing something and everytime it stops seeing something.
