# How to use Detour AI bots to path around player character?

**URL:** <https://forums.unrealengine.com/t/how-to-use-detour-ai-bots-to-path-around-player-character/318283>\
**Category:** AI\
**Tags:** detour-crowds, unreal-engine, avoidance, Blueprint, question\
**Created:** [May 12, 2015, 6:06am UTC](https://forums.unrealengine.com/t/how-to-use-detour-ai-bots-to-path-around-player-character/318283 "2015-05-12T06:06:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stormrage256](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/stormrage256/32/1008648_2.png) [@Stormrage256](https://forums.unrealengine.com/u/Stormrage256)\
**Post date:** [May 12, 2015, 6:06am UTC](https://forums.unrealengine.com/t/how-to-use-detour-ai-bots-to-path-around-player-character/318283/1 "2015-05-12T06:06:53Z")

</div>

Hi, I’m using Detour Crowd AI controller to have my AI bots avoid each other when walking along the same path. However I also want the neutral bots to avoid the player when walking towards him. As of now, they just collide with the player character and may just slide forcefully to the side or just stay there trying to move through the player. Any way to get the AI to path around the player while using Detour?

---

<div class="post-metadata">

**Author:** ![Arveum](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arveum](https://forums.unrealengine.com/u/Arveum)\
**Post date:** [May 12, 2015, 8:14am UTC](https://forums.unrealengine.com/t/how-to-use-detour-ai-bots-to-path-around-player-character/318283/2 "2015-05-12T08:14:05Z")

</div>

I’m not sure my way is the the most efficient or even an acceptable answer to some but here it goes:

I put some boxtriggers on my AI that fires a custom event in the AI’s blueprint I called Evade. What it does is it checks if the actor in the boxtrigger has the tag of ‘Player’ and if the actor does I get the players location in a vector.

Based off of that vector I tell my AI to either go left or right (whichever is closer to his original goal) by getting/calculating a vector about 2 meters right or left of the player. Then I tell the AI to go to that vector. Once he reaches the vector I then tell him to move to his original goal.

Like I said, not very efficient but works 😛

---

<div class="post-metadata">

**Author:** ![Stormrage256](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/stormrage256/32/1008648_2.png) [@Stormrage256](https://forums.unrealengine.com/u/Stormrage256)\
**Post date:** [May 12, 2015, 2:26pm UTC](https://forums.unrealengine.com/t/how-to-use-detour-ai-bots-to-path-around-player-character/318283/3 "2015-05-12T14:26:04Z")

</div>

But how do you know if this random point on the left/right lies on the nav mesh?

---

<div class="post-metadata">

**Author:** ![Arveum](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arveum](https://forums.unrealengine.com/u/Arveum)\
**Post date:** [May 12, 2015, 5:37pm UTC](https://forums.unrealengine.com/t/how-to-use-detour-ai-bots-to-path-around-player-character/318283/4 "2015-05-12T17:37:38Z")

</div>

You take your AI’s forward vector, which you can then use to determine left or right.
