# AI Move To

**URL:** <https://forums.unrealengine.com/t/ai-move-to/1157936>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, UE5, Blueprint, question\
**Created:** [May 7, 2023, 5:53pm UTC](https://forums.unrealengine.com/t/ai-move-to/1157936 "2023-05-07T17:53:06Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Godlike0207](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Godlike0207](https://forums.unrealengine.com/u/Godlike0207)\
**Post date:** [May 7, 2023, 5:53pm UTC](https://forums.unrealengine.com/t/ai-move-to/1157936/1 "2023-05-07T17:53:06Z")

</div>

Hi,

I have a problem. I want the Pawn to move like in picture 2 using the “AI Move To” function.

 ![Screenshot Move To](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/3/2/c32998e3812b50ffbfd6cf049bd7546254da90a6.png)

---

<div class="post-metadata">

**Author:** ![Godlike0207](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Godlike0207](https://forums.unrealengine.com/u/Godlike0207)\
**Post date:** [May 7, 2023, 7:31pm UTC](https://forums.unrealengine.com/t/ai-move-to/1157936/2 "2023-05-07T19:31:54Z")

</div>

Does anyone have an idea how to implement this in Blueprint?

---

<div class="post-metadata">

**Author:** ![EliasWick](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eliaswick/32/1175208_2.png) [@EliasWick](https://forums.unrealengine.com/u/EliasWick)\
**Post date:** [May 8, 2023, 8:17am UTC](https://forums.unrealengine.com/t/ai-move-to/1157936/3 "2023-05-08T08:17:33Z")

</div>

Depending on the game, it’s perhaps worth to use splines, alternatively you can use traces to shoot from the character to have it keep distance from the wall.

I don’t have much experience with AI, so hopefully someone else can chime in as well 🙂

---

<div class="post-metadata">

**Author:** ![Godlike0207](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Godlike0207](https://forums.unrealengine.com/u/Godlike0207)\
**Post date:** [May 8, 2023, 10:16am UTC](https://forums.unrealengine.com/t/ai-move-to/1157936/4 "2023-05-08T10:16:20Z")

</div>

I have been looking for a solution for days on how to implement that in Blueprint.  
No success so far.

---

<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:** [May 8, 2023, 10:29am UTC](https://forums.unrealengine.com/t/ai-move-to/1157936/5 "2023-05-08T10:29:56Z")

</div>

hi there,

You have a few options:

1. move the pawn along a predefined spline for every existing path in the level, add a logic to select randomly or the shortest path.
2. Use navmesh modifiers to create a narrow path with lower “cost”. That means the narrow path will be always the preferred choice.
3. Use waypoints for every corner, so the AI will move along intermediate points between the start and end location. Look for AI patrol points.

hope that helps.

---

<div class="post-metadata">

**Author:** ![Godlike0207](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Godlike0207](https://forums.unrealengine.com/u/Godlike0207)\
**Post date:** [May 8, 2023, 10:37am UTC](https://forums.unrealengine.com/t/ai-move-to/1157936/6 "2023-05-08T10:37:09Z")

</div>

> [@L.F.A](#):
>
> navmesh

The movement should not be predefined, but like in the picture 2. So it should move square.

---

<div class="post-metadata">

**Author:** ![Godlike0207](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Godlike0207](https://forums.unrealengine.com/u/Godlike0207)\
**Post date:** [May 8, 2023, 10:40am UTC](https://forums.unrealengine.com/t/ai-move-to/1157936/7 "2023-05-08T10:40:42Z")

</div>

> [@L.F.A](#):
>
> AI patrol points

it shouldn’t be “patrol points” either.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [May 8, 2023, 10:47am UTC](https://forums.unrealengine.com/t/ai-move-to/1157936/8 "2023-05-08T10:47:54Z")

</div>

You can try using Don’s 3d pathfinding plugin

> **[DoN's 3D Pathfinding for Flying AI in Code Plugins - UE Marketplace](https://www.unrealengine.com/marketplace/en-US/product/don-s-3d-pathfinding-flying-ai)**
>
> Volumetric pathfinding for Flying A.I. bots to navigate complex aerial corridors, aerial obstacles, 6 D.O.F 3D-mazes, etc. This fully dynamic solution supports procedural worlds with ever-changing collision geometry and other advanced use-cases.

---

<div class="post-metadata">

**Author:** ![Godlike0207](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Godlike0207](https://forums.unrealengine.com/u/Godlike0207)\
**Post date:** [May 8, 2023, 10:56am UTC](https://forums.unrealengine.com/t/ai-move-to/1157936/9 "2023-05-08T10:56:28Z")

</div>

Please no plugin. It should be a mixture of “AI move to” and "Box Trace By Channel.

---

<div class="post-metadata">

**Author:** ![EliasWick](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eliaswick/32/1175208_2.png) [@EliasWick](https://forums.unrealengine.com/u/EliasWick)\
**Post date:** [May 8, 2023, 11:00am UTC](https://forums.unrealengine.com/t/ai-move-to/1157936/10 "2023-05-08T11:00:37Z")

</div>

@Godlike0207, You have had 3 people suggesting various methods now. For future questions, I suggest that you specify the information such as:

> It should be a mixture of “AI move to” and "Box Trace By Channel.

At the top of the thread.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [May 8, 2023, 11:01am UTC](https://forums.unrealengine.com/t/ai-move-to/1157936/11 "2023-05-08T11:01:49Z")

</div>

@Godlike0207  
The plugin does exactly that. Box traces in space then finds the most efficient path.

If you want to reinvent the wheel be my guest. This plugin already does what you are asking for.

You other only option if you want pure code would be to implement an A\* algorithm to scan your corridors with the size of the cells set to width of the corridor.

> **[A\* search algorithm](https://en.wikipedia.org/wiki/A*_search_algorithm)**
>
> A\* (pronounced "A-star") is a graph traversal and path search algorithm, which is used in many fields of computer science due to its completeness, optimality, and optimal efficiency. One major practical drawback is its 
>   
>     
>       
> O
> (
>         
> b
>           
> d
>           
>         
> )
>       
>     
> {\\displaystyle O(b^{d})}
>   
> space complexity, as it stores all generated nodes in memory. Thus, in practical travel-routing systems, it is generally o Pe...

[https://www.redblobgames.com/pathfinding/a-star/implementation.html](https://www.redblobgames.com/pathfinding/a-star/implementation.html)

> **[A\* Search Algorithm - GeeksforGeeks](https://www.geeksforgeeks.org/a-search-algorithm/)**
>
> A\* Search algorithm is one of the best and popular technique used in path-finding and graph traversals.
