I’m guessing the white Parts are your placed items and the medium grey Part is the plot?
What exactly do you mean by “clipping through the plot” since 1 picture doesn’t really explain your issue very well.
If that’s all one script why do you have the same snapToGrid function twice?
Isn’t it because when you put math.floor(position.Y / grid_Size + 0.5) you are just putting it at .5 plus the position.Y divided by the grid_Size?
Shouldn’t it be math.floor(position.Y / grid_Size + grid_Size/2) to get half the height of the grid part you are placing added to the Y Position?
The PositionPartOnGrid formula is telling the Part to go to the Position returned by the snapToGrid function’s formula. You need to fix one of them to place the Part half it’s height higher on the Y axis.
You could put a print() line in after each to see what the values are for the read Position and the placed Position when you do the calculations.
It almost looks like the Part is getting placed 1/4 of it’s height too low. Maybe check it with different sized Parts to see if it’s the read Position calculation or the placed Position calculation that are getting messed up.