AI Perception gets stuck in loop of seeing and not seeing me on AI turn

I am Using AI Perception to drive my AI’s sight sense.

I have attached a screenshot of my AI Controller blueprint as well as a video demonstrating what is happening.

A bit more context:

  • Everything else works fine. If I were to myself run into the AI’s sight perception field, then it will properly get one perception update with a successful sight and chase me, when he loses me, he will do his search and then go back to patrolling.

However, I run into an issue where the AI Perception will get stuck in an endless update event loop going back and forth in failing and not failing to see me. This happens IFF the AI is the one to turn, and on that turning, they see me. At this point, as you can see in the video, the AI perception seems to flip back and forth between turning, i.e. between where it successfully sees me, and where it was looking (I think anyways, it moves too fast to tell, I’ll follow up with it going slower maybe?)

So, just curious if anyone might know how I can fix this and/or why this is happening? The AI’s movements at this point is being driven by the default “MoveTo” task (as seen in the BT) and the “Simple Move to Location” function (which isn’t seen in the BT but is used in the “BT_FindRandomLocationInRadius” task in the search loop which can be seen in the video in the Search sub-behaviorTree)

video: 2021-01-10 08-30-22.mp4 - Google Drive (recommend downloading if you want to view full quality, Drive seems to limit viewing to 720p)

AI Controller Screenshot:

Any help/insight is much appreciated!

Yea for sure you can take a look at it, just a little unreal project I have to learn AI stuffs, here’s a .zip of it here’s a link to the project zip: AdvancedLocomotionSystemV.zip - Google Drive

i could fix it but it would have to be completely re written code not sure if you wanna go that route you could zip it up and send me the link so i can download it and rewrite it for you or i can show you how i use my ai to find and chase me and patrol if he cant see me

I prefer On Target Perception Updated. This gets you a target that you can check the tag for and also the stimulus. You can break the stimulus and use the Sensed Successful bool return to determine what to do in a branch. Since this event fires when sensed and lost sensing, the bool allows you to determine what to do in both cases.

Thanks ConradG, I’ll give that a try!