OnPerceptionUpdated Vs OnTargetPerceptionUpdated

Hi, basically inside the ProcessStimuli function of the AIPerceptionComponent (which gets called in Tick of the AIPerceptionSystem) it loops through all new stimuli and calls OnTargetPerceptionUpdated for each of them. At the same time it adds all those actors into an array and at the end calls OnPerceptionUpdated with that array.

As an example imagine you have three new stimuli, (1) starts seeing actor A, (2) stops seeing actor B and (3) noise stimulus from actor B. OnTargetPerceptionUpdated will be called three times here, so seeing A, stops seeing B, hearing B. OnPerceptionUpdated would contain actor A and B.

So both will be called with the same actors, but OnTargetPerceptionUpdated gets called per actor and per sense and OnPerceptionUpdated gets called with the actors only (but you can ofc get the perception info for those actors via GetActorInfo).

Any info regarding them would be
greatly appreciated.

By the way, since you’re already using C++ you could also take a look at the ProcessStimuli function of the AIPerceptionComponent there you can find all the information =)

4 Likes