This is a tile-based modification of the first-person controller that comes as a standard asset in Unity. The player steps along the x- or z-axis in set increments based on an easily-modified variable.
Should the player attempt to move into a wall or other obstacle, they’ll bounce back to their original position.
The direction of movement is determined based on the direction the camera faces. No matter what, the player remains locked to the grid.
The end result is a fluid movement system similar to that seen in Legend of Grimrock and its sequel. The source code and a sample project are available at https://github.com/PurpleNinjaLink/TileBasedFirstPersonMovement