Trying to place block prefabs similiar to Minecraft

Hello all!
Ive spent hours trying to implement a simple 3d block placing system similar to minecraft, i know about voxel generation, and that this is an inefficient way to do this, but this is intended as a small side mechanic and im set on doing it this way, I have the following code which raycasts a preview block and moves its position accordingly, it works as intended on the ground, but when it hits another cube i just can get it to align to the normal of the hit cube, can one of you genius coders help a brother out?

if (buildModeOn)
 {
     RaycastHit hitInfo;

     if (Physics.Raycast(shootingPoint.position, shootingPoint.forward, out hitInfo, 10, buildLayer))
     {
         if (hitInfo.transform.tag == "Cube")
         {



             canBuild = true;
             Vector3 spawnPosition = new Vector3(Mathf.Round((hitInfo.point.x + hitInfo.normal.x) * 2) / 2, hitInfo.point.y + hitInfo.normal.y - 0.75f, Mathf.Round((hitInfo.point.z + hitInfo.normal.z) * 2) / 2);
             currentTemplateBlock.transform.position = spawnPosition;
         }
         else
         {


             canBuild = true;
             Vector3 spawnPosition = new Vector3(Mathf.Round((hitInfo.point.x + hitInfo.normal.x) * 2) / 2, hitInfo.point.y + hitInfo.normal.y - 0.75f, Mathf.Round((hitInfo.point.z + hitInfo.normal.z) * 2) / 2);
             currentTemplateBlock.transform.position = spawnPosition;
         }

     }

First of all, don’t write code like this:

Even “genius coders” look at that nightmare and barf. There’s just no call for that!

If you have more than one or two dots (.) in a single statement, you’re just being mean to yourself.

Putting lots of code on one line DOES NOT make it any faster. That’s not how compiled code works.

The longer your lines of code are, the harder they will be for you to understand them.

How to break down hairy lines of code:

http://plbm.com/?p=248

Break it up, practice social distancing in your code, one thing per line please.

“Programming is hard enough without making it harder for ourselves.” - angrypenguin on Unity3D forums

“Combining a bunch of stuff into one line always feels satisfying, but it’s always a PITA to debug.” - StarManta on the Unity3D forums


Once you have broken things apart, now it’s time to start debugging!

By debugging you can find out exactly what your program is doing so you can fix it.

Use the above techniques to get the information you need in order to reason about what the problem is.

You can also use Debug.Log(...); statements to find out if any of your code is even running. Don’t assume it is.

Once you understand what the problem is, you may begin to reason about a solution to the problem.