Hi, I am trying to use AIPerception’s Team Sense (additional to Sight and Hearing).
Now I have the problem that I can’t seem to get it working. I already did the following:
Added the sense to the AIPerceptionComponent in the AIController; Max Age is 0.0f
Added a Stimuli Source Component to the AIController (doesn’t work on pawn also), call RegisterSource… and RegisterSense(UAISense_Team::StaticClass()) (or sth like that) AND in Blueprint override set Auto Register and added Team sense
Call UAIPerceptionSystem::OnEvent with custom settings
Listener and Broadcaster are both AIControllers with the same GenericTeamId, so sense should be triggered
But unfortunately I never receive Team Stimulus in OnTargetPerceptionUpdated
Here is some code:
Hi,
Sorry for necroing this but I have the exact same problem.
I have 2 enemies.
In OnTargetPerceptionUpdated, I’m calling that OnEvent() function.
I put a breakpoint in OnTargetPerceptionUpdated and play the game.
When I detect an enemy, I expect the breakpoint to fire twice, since there are 2 enemies and the first one is calling OnEvent which should broadcast the event and call OnTargetPerceptionUpdated on the 2nd enemy. It doesn’t fire twice
I’ve set a StimuliSourceComponent on my EnemyActor with UAISense_Team and Auto Register as Source to true.
The issue was that the perception component of each AI was registered to the global perception system when the team id of each enemy was not set.
Hope this helps!