How to make enemy AI not be able to damage each other?

(1)How did you make teams? How did you make the enemy’s target only the player character and or not be able to damage each other? Do you use iGenericTeamInterface because i have that but don’t know how to implement it in my character BP. I’ve tried with no results. (2) Or do I use Detection by affiliation in the AIPerception component? If so I have tried using that but still no results. Im not sure if i’m using it correctly. Thank you.alt text

The problem is I have a character player that punch kicks and magic. From there I made a child and named that Enemy AI. From there I made a child of Enemy AI and named it Friendly AI. Every thing works except for when ever I play in the level the enemy’s target and damage each other as well as the player character. And the same with the friendly’s. They target and damage each other as well as the the enemy. Both the Enemy and Friendly both have there own controller and own Behavior trees.

I’m guessing you are assigning the targets by looping through the list of pawns held by the AI Perception?

You need to assign the target status there. If you only want them to attack the player, loop through the list of perceived pawns, and Cast each one to Player Character (or whatever you have named it). This will only return true if the Perceived Actor is the player. Then you can assign that to be the Target.

Of course, you may also have accidentally flipped a Boolean check, so you may need to post your BP here.

My suggestion, as I’m unfamiliar with the iGenericTeamInterface, is tagging each actor for their respective teams, you can do this at runtime as well, but that way you can determine if it’s the perception or something else.

PS.
Vanessa sent me lmao

Wow.Thanks so much. Sorry for the late response.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.