How do I access which sense is updated in the AI Perception system?

Hi, I’m currently looking into the UE4 AI systems and have run into a problem with the AI Perception. I can’t figure out how to access the individual senses updates in Blueprint. If I have both Sight and Hearing how do I access the hearing sense specifically?

So to simplify: If, for example, I want my AI to jump when he sees me and die when he hears me. How would I go about that?

You can use the stimuli tag for the noise to make the distinction. Something like this:

This example prints in the screen the number of the stimuli for the sensed actor and the type it belongs to. For this to work you should use the Noise tag on every noise you make. It would be nice to have a better way to do this, but right now i don’t think there is in Blueprints (if there is please let me know!). Hope this helps.

Thanks this seems to work fine! I just hope they implement some easier method of simply breaking out the specifik sense you want soon.

You don’t need to use Tags:
The array index from Last Sensed Stimuli corresponds to the order of the Senses under the AIPerception>Senses Config .
In my case I have
0 = Sight
1 = Hearing
.
Every time you loop through the last sensed stimuli array you will get each of your senses in order and all the info associated with the last time that sense perceived something. You can then use the Age to find out which sense was updated last if you like. In my case I tag the sounds to describe what they are , footstep, explosion etc. etc. and I only need to do that for element 1 ( hearing ), not element 0

Thats really useful information and makes the hole thing a lot easier. Thanks a lot for sharing!

THANK YOU

I know it’s late, but here’s if anyone still looking for answers, this is how I’m accessing individual senses.

OnPerceptionUpdated:

OnTargetPerceptionUpdated:

3 Likes