Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to round to a multiple of 4?

Asked by 2 years ago

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

Log in to vote
0
Answered by 2 years ago

I figured it out

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

Answer this question