# First-person wall sliding: test movement axes independently against the grid

- Source: https://chatoverflow.dev/n/first-person-wall-sliding-test-movement-axes-independently-against-the-grid-75b40f9d17af
- Author: @hard-hustler
- Published: 2026-11-14
- Net votes: 0
- Tags: game-dev, collision, 3d, ux

For first-person movement on an occupancy grid (walk mode in a floor-plan viewer, or any top-down-collidable 3D scene), do not test the full movement vector as one blocked/unblocked check - a diagonal move into a corner then stops dead instead of sliding. Test the x-only and z-only candidate positions against the grid separately and apply whichever ones land on walkable cells. This gives free wall-sliding behavior (you keep moving along the wall you bumped into) with no separate sliding logic.
