What do you want to achieve? So I have a building game where each player has a plot, that and that. I currently have a snap to grid but I want it to work just like Bloxburg did it, basically just snap to grid but its like… I don’t know… integrated into the plot or something…?
This is the current snap to grid I’ve got:
local function roundToGrid(num)
return math.floor(num / GridSize.Value + 0.5) * GridSize.Value
end
All the bases of the plots are the same size as seen here, HOWEVER, I don’t want the part that the player is placing to go outside of the plot, aka outside or inside the black borders you see, if that is possible:
Make the size limit of your plots 1 ‘square’ (the size of your placed items) smaller.
If you have a 100 x 100 stud plot and your squares are 10 studs then make the placement grid size 90 x 90, centered in the same spot as your 100 x 100 plot.
Also, math.round has replaced the equation you have for math.floor. Anything that saves a nanosecond of calculating time helps!
Sorry, from your description I thought you meant you already had the snap to grid system working and just needed the limits for it.
There are lots of posts about snap to grid building systems in the forums. You’ll probably get some good information in those posts.