Modulo Sign but for Rounding Math?

Hi so I never saw the ‘%’ sign being used in this way before:

local grid = 0.5 --grid size of 0.5 studs

local function round(vector)
    return vector - Vector3.new(vector.X % grid, vector.Y % grid, vector.Z % grid)
end

What does the percentage sign (%) do? Thanks!

x % y returns the remainder when x is divided by y.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.