# Move only along grid points

**URL:** <https://forums.unrealengine.com/t/move-only-along-grid-points/1149104>\
**Category:** Blueprint\
**Tags:** ai-navigation, pathfinding, beginner, unreal-engine, grid, question\
**Created:** [April 29, 2023, 11:28pm UTC](https://forums.unrealengine.com/t/move-only-along-grid-points/1149104 "2023-04-29T23:28:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![poonjogger](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@poonjogger](https://forums.unrealengine.com/u/poonjogger)\
**Post date:** [April 29, 2023, 11:28pm UTC](https://forums.unrealengine.com/t/move-only-along-grid-points/1149104/1 "2023-04-29T23:28:17Z")

</div>

Hello, I am trying to modify the behavior of the pathfinding that MoveToLocation uses, or replace it with something that will work.  
I would like the path to essentially snap to grid, (just like VectorSnappedToGrid) like so  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/9/7/c979d4a8f7e9cc4fc36ab95f11576f032179f2b6.png)  
so the pawn only moves in 45 degree angle increments between “grid points”.

The pawn already starts and ends based on VectorSnappedtoGrid.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/a/8/ba8ede5df36b815100d38e080b29db962e038b63.png)

I have tried to use Find Path to Location Synchronously

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/2/0/1207040fdce2c7e3fed350d4ad09170996de1ce8.png)  
But i think the issue is that it only generates two path points when walking in a straight line (like the left side of my first image) where it would need 3 or more (right side).

Any help with this would be appreciated!

---

<div class="post-metadata">

**Author:** ![JoSf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JoSf](https://forums.unrealengine.com/u/JoSf)\
**Post date:** [April 30, 2023, 8:24pm UTC](https://forums.unrealengine.com/t/move-only-along-grid-points/1149104/2 "2023-04-30T20:24:24Z")

</div>

Split the move to location in two parts, first find a location where the turning is supposed to happen, then move from there to the final location.

If this is supposed to be some turn-based implementation for a game, I advice against using the built-in navmesh tools and building your own (look into Dijkstra) or getting a marketplace asset that does it for you.

The tools provided by Unreal are made with games such as UT in mind.

---

<div class="post-metadata">

**Author:** ![poonjogger](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@poonjogger](https://forums.unrealengine.com/u/poonjogger)\
**Post date:** [April 30, 2023, 8:34pm UTC](https://forums.unrealengine.com/t/move-only-along-grid-points/1149104/3 "2023-04-30T20:34:23Z")

</div>

Thanks, I will look into that. I’m mostly just trying to constrain pawn movement along the same grid that VectorSnappedToGrid uses.

---

<div class="post-metadata">

**Author:** ![buzzlightyear139](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@buzzlightyear139](https://forums.unrealengine.com/u/buzzlightyear139)\
**Post date:** [June 4, 2024, 9:46pm UTC](https://forums.unrealengine.com/t/move-only-along-grid-points/1149104/4 "2024-06-04T21:46:21Z")

</div>

I am sitting with this almost exact same problem, only difference is I want to only allow 90 degree movement. Did you ever find a solution?

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [June 5, 2024, 3:06am UTC](https://forums.unrealengine.com/t/move-only-along-grid-points/1149104/5 "2024-06-05T03:06:24Z")

</div>

As JoSf said you really need your own pathfinding for this, likely A\* or Dijkstra
