*I’ve read all existing replies and articles about the topic. Tried Implementing IGenericTeamInterface on PlayerController and on PlayerCharacter base class as well + numerous experimentations with no success.
Goal: AI perception system to detect other AI character (with the same TeamId) as friendly and A player character (different TeamId) as Enemy.
Here’s a story short:
I am trying to make AI perception detect by affiliation working. So that AI will detect other AIs and a player as friendly or enemy. Was following this short article to implement IGenericTeamInterface, that should allow AI to detect other actors by affinity. By default, AI sees all other characters as Neutrals.
I’ve created a small third person project, where I did all the setup and modifications for Controller classes:
https://drive.google.com/open?id=137…t_nGZQGyHVLSmV
I did exactly what was in the article, and here are all code changes, that I have applied are these:
- Created new AI controller class, derived from AAIController with some additional functionality that adds TeamID and GetRenericteamID() function.
- Created new Player controller class and implemented IGenericTeamInteface there.
AI controller “should” (and this is my assumption from what I have learned about Generic team ID implementation) cast to IGenericTeamInteface perceived actor’s controller, and then simply compare TeamId values. If values are the same, it is supposed to mark other characters as friendly, if they are different, as enemies.
Unfortunately this never gets called. AI Perception system always detects all actors as Neutrals, no matter what I do. I see that TeamID is being assigned on construction for both controllers, but it never gets into consideration by AI controller. I was looking into code, but I do not see the cause of the problem.
Would really appreciate any help!
Thank you,
K