How would I go about making a part snap to a grid

There’s an existing tutorial on the devforum that I think can help you. You can skip to the Grid Placement section.

This is a small snippet of the tutorial that explains how to snap the part to a grid

Everything looks good, but sometimes we might want to be locked to a grid. To do this we return to our :CalcPlacementCFrame() method and round the x and y variables to the nearest grid value.

function Placement:CalcPlacementCFrame(model, position, rotation)
	-- one of the properties I didn't explain earlier
	local g = self.GridUnit
	if (g > 0) then
		x = math.sign(x)*((math.abs(x) - math.abs(x) % g) + (size2.x % g))
		y = math.sign(y)*((math.abs(y) - math.abs(y) % g) + (size2.y % g))
	end
end

Now say we set GridUnit to 2 then our placement system will be locked to a 2x2 grid!

1 Like