How to use multiple Senses for a Perception Component?

I have gotten both Hearing and Sight to work separately, but when I run them together registered as such:

    PerceptionComp->SetDominantSense(SightConfig->GetSenseImplementation());
PerceptionComp->ConfigureSense(*SightConfig);
PerceptionComp->ConfigureSense(*HearingConfig);

The Perception component only returns whichever SenseConfig is configured first, as opposed to returning results from both hearing and sight.

Any ideas on how to fix this?

Hey NordicTiger,

Your OnSenseUpdate function should look something like this:

OnSenseUpdate(TArray<AActor*> testActors)
{
// check each sensed actor
	for (AActor* actor : testActors)
	{
	// Get all the stimuli 
		FActorPerceptionBlueprintInfo info;
		GetAIPerceptionComponent()->GetActorsPerception(actor, info);

		for (FAIStimulus stim : info.LastSensedStimuli)
		{
		// Sight or Hearing sense
		}
	}
}

This way you can check each sense separatly.

Hope this helps :slight_smile:
Elias

This has shed a little bit more light on the problem, but I’m no closer to fixing the problem. Now, my On Screen logging returns Default_AISense_Sight and Invalid. If I switch the two configure sense lines above, then I have Default_AISense_Hearing and Invalid.

It really appears as if I can only parse through one sense.

They do have to sense something before they work, did you tested that?