Line trace then spawn block in grid

I’m trying to create a minecraft like building mode and need help with spawning the blocks in grid like units. I’m using a box line trace to get and set the coordinates of the spawn vector, and from there I have the player spawn a block at the new vector. My problem is that the blocks can be spawned inside the floor. How do I get the blocks to spawn on top of the floor and not into each other. Also was it not a good idea to Use a box trace? I will include a picture in the morning, since it will probably help