# Running multiple behavior trees on a single actor

**URL:** <https://forums.unrealengine.com/t/running-multiple-behavior-trees-on-a-single-actor/614215>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [July 25, 2022, 11:23pm UTC](https://forums.unrealengine.com/t/running-multiple-behavior-trees-on-a-single-actor/614215 "2022-07-25T23:23:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SgtFlexxx](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sgtflexxx/32/1194634_2.png) [@SgtFlexxx](https://forums.unrealengine.com/u/SgtFlexxx)\
**Post date:** [July 25, 2022, 11:23pm UTC](https://forums.unrealengine.com/t/running-multiple-behavior-trees-on-a-single-actor/614215/1 "2022-07-25T23:23:12Z")

</div>

My plan for some friendly AI followers was that I wanted two separate behavior trees for each of them: One that decides what happens pathfinding-wise, and one that decides what happens combat-wise (Since the AI are capable of moving and attacking at the same time). I was wondering if it’s even possible to run multiple behavior trees per AI at the same time, and if so, how?

“Run Behavior” never seems to enter when using a Simple Parallel node, and using two “Run Behavior Tree” blueprint nodes in the AI controller causes the former one to exit

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/a/2/2a2d3be7e38907d520c93b6f8ffc4a760dcadd42.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/3/f/33fcdf754eb21f1ccc83d7a102a3433c3f2b9c16.png)

---

<div class="post-metadata">

**Author:** ![jwatte](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jwatte/32/744941_2.png) [@jwatte](https://forums.unrealengine.com/u/jwatte)\
**Post date:** [July 25, 2022, 11:27pm UTC](https://forums.unrealengine.com/t/running-multiple-behavior-trees-on-a-single-actor/614215/2 "2022-07-25T23:27:16Z")

</div>

No, that’s not generally possible. In the general case, two different trees might give conflicting commands to the Pawn.

You could perhaps do this by creating a second, hidden, pawn, that exists but doesn’t collide and doesn’t render, and use that for the path finding decisions, and then somehow merge the outcomes? But it’s probably better to just merge the behaviors of moving and attacking into the one tree.

---

<div class="post-metadata">

**Author:** ![sethangelo9](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sethangelo9/32/554562_2.png) [@sethangelo9](https://forums.unrealengine.com/u/sethangelo9)\
**Post date:** [July 26, 2022, 1:43am UTC](https://forums.unrealengine.com/t/running-multiple-behavior-trees-on-a-single-actor/614215/3 "2022-07-26T01:43:17Z")

</div>

Can someone help me please?? I’m trying to post to the forum and keep receiving this message.

 ![Screen Shot 2022-07-25 at 6.35.46 PM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/c/0/bc09c3f567615604d5b4fb9c5c122d583e0663d9.jpeg)

---

<div class="post-metadata">

**Author:** ![L.F.A](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/l.f.a/32/1194525_2.png) [@L.F.A](https://forums.unrealengine.com/u/L.F.A)\
**Post date:** [July 26, 2022, 11:34am UTC](https://forums.unrealengine.com/t/running-multiple-behavior-trees-on-a-single-actor/614215/4 "2022-07-26T11:34:35Z")

</div>

Hi there,

You don’t need two behavior trees, you want “services”. If you examine the behavior tree shipped with Lyra, there’s a setup in which multiple services can be stacked up in one branch for “multi-tasking”. Each service can run at different “tick” intervals. Services can also be combined with tasks based on conditional checks.

If you play Lyra, examine the bots’ behavior, as they attack, reload, find ammo, and move to find better attack positions.

Hope that makes sense.
