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

**URL:** <https://forums.unrealengine.com/t/how-to-make-enemy-ai-not-be-able-to-damage-each-other/453373>\
**Category:** Community & Industry Discussion\
**Tags:** unreal-engine, enemy, question\
**Created:** [August 5, 2019, 3:55am UTC](https://forums.unrealengine.com/t/how-to-make-enemy-ai-not-be-able-to-damage-each-other/453373 "2019-08-05T03:55:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jazz904](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jazz904](https://forums.unrealengine.com/u/Jazz904)\
**Post date:** [August 5, 2019, 3:55am UTC](https://forums.unrealengine.com/t/how-to-make-enemy-ai-not-be-able-to-damage-each-other/453373/1 "2019-08-05T03:55:24Z")

</div>

(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

---

<div class="post-metadata">

**Author:** ![Jazz904](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jazz904](https://forums.unrealengine.com/u/Jazz904)\
**Post date:** [August 5, 2019, 3:56am UTC](https://forums.unrealengine.com/t/how-to-make-enemy-ai-not-be-able-to-damage-each-other/453373/2 "2019-08-05T03:56:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jezcentral](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jezcentral](https://forums.unrealengine.com/u/Jezcentral)\
**Post date:** [August 5, 2019, 8:20am UTC](https://forums.unrealengine.com/t/how-to-make-enemy-ai-not-be-able-to-damage-each-other/453373/3 "2019-08-05T08:20:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![FeFiFoChizzle](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FeFiFoChizzle](https://forums.unrealengine.com/u/FeFiFoChizzle)\
**Post date:** [August 17, 2019, 4:44am UTC](https://forums.unrealengine.com/t/how-to-make-enemy-ai-not-be-able-to-damage-each-other/453373/4 "2019-08-17T04:44:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jazz904](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jazz904](https://forums.unrealengine.com/u/Jazz904)\
**Post date:** [February 1, 2020, 7:46am UTC](https://forums.unrealengine.com/t/how-to-make-enemy-ai-not-be-able-to-damage-each-other/453373/5 "2020-02-01T07:46:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [February 22, 2024, 1:00am UTC](https://forums.unrealengine.com/t/how-to-make-enemy-ai-not-be-able-to-damage-each-other/453373/6 "2024-02-22T01:00:59Z")

</div>

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