# BB Key changing for all AI (instead of just 1)

**URL:** <https://forums.unrealengine.com/t/bb-key-changing-for-all-ai-instead-of-just-1/490212>\
**Category:** AI\
**Tags:** Behavior-Tree, blackboard, attack, unreal-engine, melee, question\
**Created:** [October 25, 2021, 3:26am UTC](https://forums.unrealengine.com/t/bb-key-changing-for-all-ai-instead-of-just-1/490212 "2021-10-25T03:26:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zoiddenbergen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zoiddenbergen](https://forums.unrealengine.com/u/Zoiddenbergen)\
**Post date:** [October 25, 2021, 3:26am UTC](https://forums.unrealengine.com/t/bb-key-changing-for-all-ai-instead-of-just-1/490212/1 "2021-10-25T03:26:24Z")

</div>

I have multiple AI characters of the same class, with the same AI controller/ behavior tree / blackboard. They are melee units that start attacking based on the Blackboard Key boolean “TargetMeleeRange”. However, any time I try to change the Blackboard Key, it impacts ALL units of the class in the game. This ultimately causes **every unit to start swinging/attacking** if just one of them is in melee-range of my character (regardless of where they are on the map).

I’ve tired using a BTService:

 ![350976-ai-btservice.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/8/c/a8cd382bee0abe60f9f60560dbaa4232a1c291df.png)

…as well as logic in the AI controller itself.

 ![350977-aicont.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/8/d/58d69ae7c6ec3f63d8dbb59c6810d82b21c8175f.png)

…and every variation of accessing the blackboard & setting the value. I’ve tried changing the bool on cast fail - the result is the same (every pawn’s boolean BB Key is impacted).

No matter what happens - every AI’s bool value get’s impacted, not just the one who triggered the event.

![350978-aivar.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/a/4/6a4357e61ac25017200af6adfb501c87c2d57599.png)

---

<div class="post-metadata">

**Author:** ![Zoiddenbergen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zoiddenbergen](https://forums.unrealengine.com/u/Zoiddenbergen)\
**Post date:** [October 25, 2021, 11:05pm UTC](https://forums.unrealengine.com/t/bb-key-changing-for-all-ai-instead-of-just-1/490212/2 "2021-10-25T23:05:23Z")

</div>

Inexplicably, after creating a new bool in the blackboard, and swapping the variables to the new bool, everything worked according to plan. I even renamed the new/working variable, and it still works. No idea why this happened but its solved.

---

<div class="post-metadata">

**Author:** ![MysticMedy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MysticMedy](https://forums.unrealengine.com/u/MysticMedy)\
**Post date:** [October 26, 2021, 7:36pm UTC](https://forums.unrealengine.com/t/bb-key-changing-for-all-ai-instead-of-just-1/490212/3 "2021-10-26T19:36:28Z")

</div>

maybe you checked this box by mistake ?

 ![351089-instance-synced.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/2/5/d2562921e9067c9fef1e7a16d0535781da71c07a.png)
