# Moving on a grid

**URL:** <https://forums.unrealengine.com/t/moving-on-a-grid/1429557>\
**Category:** Blueprint\
**Tags:** unreal-engine, grid, characters, Blueprint, question\
**Created:** [November 28, 2023, 7:25pm UTC](https://forums.unrealengine.com/t/moving-on-a-grid/1429557 "2023-11-28T19:25:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sweeetjd](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sweeetjd/32/782492_2.png) [@sweeetjd](https://forums.unrealengine.com/u/sweeetjd)\
**Post date:** [November 28, 2023, 7:25pm UTC](https://forums.unrealengine.com/t/moving-on-a-grid/1429557/1 "2023-11-28T19:25:18Z")

</div>

I’m building a game in which the player can run along a grid on either the X or Y plane, but never both at the same time. The script works fine, except when changing directions there is a bit of a lag in changing directions, caused by the “Recenter Pawn” function making sure that the pawn is on the grid. I would like to remove this lag, but I don’t know how to do it without making the player jump instantly onto the grid.

This blueprint shows one axis of movement and the “Recenter Pawn” function. The other axis is the same, just with the X and Y values switched.

[Movement posted by anonymous | blueprintUE | PasteBin For Unreal Engine](https://blueprintue.com/blueprint/7-1ioi5o/)

---

<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:** [November 29, 2023, 8:28am UTC](https://forums.unrealengine.com/t/moving-on-a-grid/1429557/2 "2023-11-29T08:28:39Z")

</div>

i would think generally in grid movement you wouldnt allow changing directions mid move?

otherwise i’d say only recenter the pawn when its movement input is 0, ie its finished moving so snap to nearest grid?

---

<div class="post-metadata">

**Author:** ![sweeetjd](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sweeetjd/32/782492_2.png) [@sweeetjd](https://forums.unrealengine.com/u/sweeetjd)\
**Post date:** [November 29, 2023, 6:15pm UTC](https://forums.unrealengine.com/t/moving-on-a-grid/1429557/3 "2023-11-29T18:15:16Z")

</div>

I want to make it so that if the player is pressing and moving forward, and then press right, the right input will wait until the player has reached the next grid square, then turns and overrides forward, if that makes sense?

---

<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:** [November 30, 2023, 3:29am UTC](https://forums.unrealengine.com/t/moving-on-a-grid/1429557/4 "2023-11-30T03:29:31Z")

</div>

yep so i’d just ignore all input while its moving using a bool
