Grid snapping in unity editor
There are virtual grid in the editor's Scene view that help you to align GameObjects snapping(moving) to the nearest grid
Aligning (Moving) to the grid
GameObject can be move to the single axis or along all axis to the closest grid. To move a gameObject to closest grid open Grid and snap window by either method
- From Main unity menu, Choose Edit>Grid and Snapping Setting
- From the grid visible in scene view menu open the overflow menu and choose Edit Grid and Snap Setting
in grid and snap setting you will find Align selection sector click on x, y, or z button or to all axis
or you can did the same work by selecting the gameobject and pressing Ctrl + \ key together for windows and command+\ key for macOS.You can use increment Snap Section to modify how much you want to move and along which axis.
Showing and Hiding Grid lines
By toggling the grid visibility button in scene view toolbar you can display or hide grid on any axis (x, y, z )
You can also change grid to any axis x, y, z to show by clicking grid visibility drop down menu and can change axis.
In grid setting You will find Opacity and from here you can change opacity of grid.
Changing default color of grid
You can change color of grid in scene view by opening unity preferences setting by navigating Edit > preferences and then click on color.
after clocking colors you will find grid and now you can change color of grid.
adjusting the grid's location
Use Shift+[ keys to move grid backward.
Use Shift+] keys to move grid forward.