Hello, I'm currently trying to make my own Stamper Tool, a problem I'm mainly having throughout making the models and parts snap to a grid is the Y Axis. The models and parts are in the ground. Here's the function I'm currently using to have the models and parts snap onto a grid.
local grid = 4 local function RoundToNearest(ToRound, Increment) return floor(ToRound / Increment + 0.5) * Increment end local function snap() local positon = mouse.Hit.p return CFrame.new(RoundToNearest(positon.X, grid), RoundToNearest(positon.Y, grid), RoundToNearest(positon.Z, grid)) end
My question is, how would I determine the Y-Axis of the model/part while also making sure you could build the models/parts upon each other.
Seems like the issue in the image is that the ground isn't at the same level as the grid, if you lower the ground it should work fine - You could also do RoundToNearest(position.Y, grid) + 2 or however deep it is in the ground there.