Need help checking the type of the stimuli in my OnPerceptionUpdated function

Hi, i’m working on getting hearing in for my AI but first i would like to know how you check the type of the stimuli for a actor.
I want to know this since i want the AI to do different things depending if the AI can see or hear the player.

I was thinking that you might be able to use something like this:

PerceptionInfo->LastSensedStimuli[j].Type == 

So that it will end up like this:

if(PerceptionInfo->LastSensedStimuli[j].Type == Sight)
    // Do sight related things
else if(PerceptionInfo->LastSensedStimuli[j].Type == Hearing)
    // Do hearing related things

But i can’t really figure out what to check the .Type against. I have been looking through the source code but cannot find the names for the various senses.

Am i thinking wrong and it is done some other way or can you do it like this, and if so what do you check the .Type variable against?

You’re almost there :slight_smile: Try this:

PerceptionInfo->LastSensedStimuli[j].Type == UAISense::GetSenseID<UAISense_Hearing>();

(or something along those lines, can really test this out now, but that’s the general idea :D)