# \[Resolved\] Problem with AI Perception Update

**URL:** <https://forums.unrealengine.com/t/resolved-problem-with-ai-perception-update/714002>\
**Category:** AI\
**Tags:** aiperception, perception-component, unreal-engine, CPP\
**Created:** [November 23, 2022, 3:59pm UTC](https://forums.unrealengine.com/t/resolved-problem-with-ai-perception-update/714002 "2022-11-23T15:59:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RegularSquirrel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/regularsquirrel/32/751761_2.png) [@RegularSquirrel](https://forums.unrealengine.com/u/RegularSquirrel)\
**Post date:** [November 23, 2022, 3:59pm UTC](https://forums.unrealengine.com/t/resolved-problem-with-ai-perception-update/714002/1 "2022-11-23T15:59:26Z")

</div>

Hello.

I’m trying to set up an AI perception system, using C++, but I’ve run into an issue.

I got the perception system running, when I enable debug I can see the ai perception is able to detect other actors, the problem that I’m facing is that the code that’s suppsed to run, when the perception detects something, doesn’t seem to want to run.  
I have put a stimulus source on the other actors.

I have tried several different things I’ve found through google, with no luck.

I’ve attached images of the AIController’s constructor, where I set up the perception system.  
The function I’m trying to call, when perception is updated,  
And Where I set up the stimulus source, in the actor’s constructor.

Thanks in advance.

 ![Perception set up in ai controller constructor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/a/e/cae9d77a0e1d5f58b06408c9eb45b626a94b9076.png)  
 ![Function to run on perception updated](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/c/7/ec76ef8cbba70b2a9a3bdfbdea572de6c2aa6284.png)  
 ![Adding stimulus soruce in actor's constructor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/0/f/20fc7629cbd1fe394c512845693f23641b4d9ee2.png)

---

<div class="post-metadata">

**Author:** ![RegularSquirrel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/regularsquirrel/32/751761_2.png) [@RegularSquirrel](https://forums.unrealengine.com/u/RegularSquirrel)\
**Post date:** [November 23, 2022, 10:13pm UTC](https://forums.unrealengine.com/t/resolved-problem-with-ai-perception-update/714002/2 "2022-11-23T22:13:07Z")

</div>

Found a solution. Added UFUNCTION() to OnObjecttSensed().
