AI sight percerption

I have a zombie with a perception component that has sight and hearing. The sight by itself works fine and the hearing triggers correctly when I fire the gun but the sight also triggers even if the zombie can’t see me. It also sees and loses sight of me in an endless loop. I tried debugging the code but I don’t know what’s happening.

Bump up to the top

Puts on moderator hat
Ahem… Please wait 4-7 days before bumping and add something if possible :slight_smile:

Takes off hat

Without seeing how you’ve got it setup, kinda hard to debug :frowning:

There are AI debugging options: How to enable AIPerception Debug Mode?

And another choice is to implement the IAISightTargetInterface for your character and add your own debug lines etc.
See : AI Perception - Custom Sight Strength In C++?

I have the same setup - one AIPerceptionComponent and 2 senses in it - Sight and Hearing.
Because component have only one OnPerceptionUpdated delegate, it looks like you cannot get which actor detected with Sight, and which one with Hearing.
Maybe you need to use 2 perception components, one for each sense, and 2 different functions binded to that delegate.

In my setup I’m using one delegate, so if character sees or hearing hostile pawn, he is already have an enemy and runs to it.