Detection by Affiliation problem

My AI cannot detect player if I don’t check everything in Detection by Affiliation.
I feel like my 3rd person character and first person character are in the same Neutrals category.
Detection by Affiliation will be checked only enemy by default, so AI cannot detect player(first person character).But If i check neutrals, AI will detect other 3rd person character too.
I tried googling about setting Affiliation to 3rd person character and first person character, but I found nothing.
I don’t know, because I am using difference version of ue4 or not(4.13.2).and i tried to find the explanation about it in the old lesson,but I found nothing.

Should i go to the next lesson, or waiting for the solution. or can someone explain about Detection by Affiliation for me?

and sorry for my bad grammar.

I was also struggling with this, as I’m sure we all want to have more than one enemy in our scene…

The documentation in Unreal is… sparce…

But I did find a good tutorial on setting up affiliation here.

It’s a bit of extra C++ coding, and you’ll have to make a C++ class based on the default AIController to add the affiliation code (literally one line in a constructor) and reparent your AIController class… That’s the easy part…

The hard part is the changes to the PlayerController, adding an Interface, and implementing a function.

Once it’s done, you can check “enemies” and leave the rest unchecked.

1 Like

Hello Brian
I read this article but I don’t quite understand:

  1. which Character must be add the AIPerceptionStimuliSourceComponent FirstPerson or ThirdPerson ?
    I think it’s FirstPerson but I am not sure.

I think Logic is follow:
override function GetGenericTeamId() returns value which is read from AIPerception and if it true Character will be perceived as Enemy, is not it ??

  1. Can we write this code only in Blueprint ?
  2. and why we need PlayerController at all as you told ?

Privacy & Terms