Whether you’re working with a modular set of assets or not you’ll want to have some control over how things fit and snap together. Unity has built-in tools to get the job done, plus an epic tool in the package manager (for free) and some assets on the store to take things even further.
Let’s dig in.
Built in tools
Grid and Snap
Unity’s built in snapping tools provide a fast simple way to snap things into a grid.
You’ve got the ability to set the snap distance independently for each axis, and to force snap into the global grid.
Open up the dockable by clicking
Edit > Grid and Snap Settings
The built-in snapping tools work by holding the CTRL (mac Option) key while dragging the transform gizmo. The object will then move on the appropriate axis while snapping to the set increments.
NB – If the object is NOT aligned to the global grid, it will continue to remain unaligned and move by the correct increment.
So snap settings of 1 for all 3 axes will snap objects to X,Y and Z coordinates in multiple of 1. But an object at
8.62, 0, 0 will move to
7.62, 0, 0 on its next snap, not
7, 0, 0.
Click “All Axes” in the snap window to align things before you start CTRL+dragging them around.
Holding V will enter vertex snap mode and the cursor will auto highlight the nearest vertex on the selected gameobject.
Clicking and dragging will then auto snap the selected vertex to the nearest vertex on other gameobjects.
A perfect tool to align things to a terrain, or even snap into place. Used on things like modular pieces you can get an instant perfect alignment.
Progrids – Via the Package Manager
ProGrids is a part of the ProBuilder family, long ago acquired by Unity.
To add ProGrids into your project click
Window > Package Manager
Advanced > Show preview packages
Now find ProGrids and Install
The ProGrids toolbar will appear in the left hand side of the scene view and it’s many options can be changed on the fly as needed. The single greatest benefit it brings over the built in snap is it snaps to the assigned grid as you drag items out from the project window. You can quickly and easily drag and snap pieces into place to rough out a level or build with modular pieces.