Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to round to a multiple of 4?

I would like to know how I could round a number to a multiple of 4 for a Grid placement system. It is in Vector3 format.

1 answer

I figured it out

local function Round4(Round)
	local result = Round / 4
	result = math.round(result)
	return result * 4
end

This discussion is preserved as it was. New answers, comments, and votes are closed.