Limited Grid-Based Movement in Godot 4.2 3D

Godot Version



Hello! I am currently trying to develop a game based off the Megaman Starforce 3 Battle System. I am struggling to find up to date tutorials on how I could go about limiting the movement to a 1x5 square grid similar to this gif IN 3D.

Any help at all would be really appreciated. Thanks!

Hi, limiting the character’s movement to a grid in 3D is similar to doing it in 2D, since you don’t seem to be using the y axis.

You can use the _input or _unhandled_input (prevents ui input from moving the player) to detect a key press. Or you do it in the process function. Then just add tile_size * direction (do not normalize it if you’re moving diagonally) to the player’s current position. You don’t need to use characterbody for this since you won’t be using move and slide.

If the player is already on the edge of the grid, don’t move them.


You are the best, thank you so much!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.