This is one of my first steps to creating a 4x4 grid. Say I click on a position at Vector3.new(3, 6, 13). I want to round that position to my 4x4 grid so I would probably do this??
function round(pos)
pos = Vector3.new(pos.X%4, pos.Y%4, pos.Z%4)
return pos
end
-- now round(Vector3.new(3, 6, 13) should round to Vector3.new(4, 8, 12)????

3 comments
will this work even if decimals are in the numbers? this is my last question.
Yes. The place it defines the number to round is in math.floor. That removes decimals.
great thanks