so i have a part dragging code and i want to add grid system so it snaps in a grid where the grid increment is determined by a textbox but im very bad at math and i dont know how to make a grid snap system here is the current code where it doesnt have grid snapping
mouse.Move:Connect(function()
if part and drag == true then
local position = {x = ms.Hit.X;y = ms.Hit.Y;z = ms.Hit.Z;};
part.Position = Vector3.new(position.x,position.y + part.Size.Y/2,position.z)
end
end)