Moving on a grid

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

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?

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?

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