AI Perception will never lose sight

Hello everyone! I have been working on a AI project just to use as a notebook for whenever I need it for certain project. Everything was going well until I started perception… AI WILL NEVER STOP LOSING SIGHT OF ME NO MATTER WHERE I AM IN THE MAP, NO MATTER HOW LONG I AM OUT OF SIGHT THE AI WILL KEEP CHASING ME. I swear I have this exact same problem every time I use perception. Sometimes it works and sometimes it doesn’t. I just added a small tweak in behavior trees for testing and all of a sudden AI will never lose sight of me. I got rid of what I had just done and nothing happened. I swear this is a bug that will never go away. Please I really need help. I have screenshots.

  • Thanks.

Hi, in your second image you never check whether the OnTargetPerceptionUpdated triggered from a successfully sensed event or not (so you never check whether it updates because it starts seeing the actor or stops seeing it). So when the AI sees an actor that has a TEAM1 tag then you set the value as bool and also if it loses sight of an actor that has a TEAM1 tag you also set the value as bool.

So you need to break the Stimulus struct and check whether SuccessfullySensed is true or false if you want to execute different logic when it sees something and loses sight of something.

THANK YOU EVERYTHING WORKS!!! What you said was helpful and detailed.