How to Filter AI Perception in Blueprint?

The issue is like this: I’ve set AI Sight sensor, and a simple Behavior Tree to follow and shoot player if it’s discovered.
Yet when I set multiple AI enemies in one map, their AI Sight sensor will also detect each other which will stop the Behavior Tree action.
I tired to use group yet as you all know I can only define friendly, enemy in C++ which I’m not familiar with.
Is there anyway to solve this problem in Blueprint? The official documents said I should use Gameplay Tags but I can’t find any instruction to demonstrate how.

Hi,

Is there anyway to solve this problem in Blueprint?

not really.

In blueprint you would need to do it manually from scratch afterwards (implement your own team system from scratch). So you detect all, and then you build your own logic to filter on top.

You could implement it like it was done in C++. Having the actors implement an interface to extract a team id from them. Then create a function that compares two team ids and returns an affiliation between them.

What I did is use tags to tag the player as Player and enemies as Enemy.
Then, I would use “Actor Has Tag” which returns a bool, and if true, assign that character to a variable.
It works quite well.

Also, you can use AIPerceptionStimulus, but I never used that. Probably is the better option, but that means you have to add it to everything that you want the AI to notice.

Hello,

I’m only having a very simple action tree which only react to Player. Yet sometimes when a Enemy character enters the sensor, it will cause the sensor losing track of the Player somehow.

1 Like

Again, I use a tag on player and enemy characters.
In the AI Controller, I check if the character this AI is seeing has a player tag(actor has tag node), and if true, then continue its actions.

1 Like

Thx, I will try if it works.

1 Like

If you have any more issues, contact me.