Half block placement system

I use this line of code to get the position for blocks

return part.Position + normal * part.Size

and it works great for full blocks.

However, I wanna add slabs. This is what happens with slabs


The other thing to note, is I want the position of the slab to be relative to the face you have the mouse over

if normal.X ~= 0 or normal.Z ~= 0 then -- Placed on side of block
	if position.Y >= part.Position.Y then -- Top half
		
	end
elseif normal.Y < 0 then -- Placed on bottom face of block
	
end
1 Like

Something along the lines of:

slab.CFrame = CFrame.new(position+normal*blocksize/4,position+normal)

Should work fine
Where position is the gridded position on the center of the blocks face which is touching the mouse
Normal is the normal vector from said face
blocksize is the dimension of the square block

I’m looking to just return the value, not set it. This is a module, and so needs to work across all block sizes automatically