How to fix the blocks placement?

I have a script that places blocks. But when I look down, it places one on the top of me. How to fix it?

using UnityEngine;
using System.Collections;

public class Build : MonoBehaviour
{
    public GameObject prefabToCreate;
    public Transform sillouetteTransform;
    Vector3[] positions = new Vector3[256];
    int currentArrayPos = 0;
    Ray ray;
    RaycastHit raycastHitInfo;
    Vector3 placePos;
    bool canBuild = true;
    bool canShowSlt = true;

    void FixedUpdate()
    {
        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        if (Physics.Raycast(ray, out raycastHitInfo, 10))
        {
            placePos = new Vector3(Mathf.Floor(raycastHitInfo.point.x), Mathf.Floor(raycastHitInfo.point.y), Mathf.Floor(raycastHitInfo.point.z));
            for (int i = 0; i <= 255; i++)
            {
                if (positions *== placePos)*

{
canShowSlt = false;
break;
}
}
if (canShowSlt)
{
sillouetteTransform.gameObject.SetActive(true);
sillouetteTransform.position = placePos;
} else
{
canShowSlt = true;
sillouetteTransform.gameObject.SetActive(false);
}
if (Input.GetMouseButtonDown(1))
{
for (int i = 0; i <= 255; i++)
{
if (positions == placePos)
{
canBuild = false;
break;
}
}
if (currentArrayPos > 255)
{
canBuild = false;
}
if (canBuild)
{
Instantiate(prefabToCreate, placePos, new Quaternion());
positions[currentArrayPos] = placePos;
currentArrayPos += 1;
}
else
{
canBuild = true;
}
}
}
}
}
Also, there are other placement bugs.

Please give more detail. However what I think is happening is that at the start you say if the raycast hits the floor the block is created, or so I think. I might be wrong. But when you say that, and you look down, obviously the raycast hits the floor right under you, and the block can’t be made inside of you, so it goes on top of you. I hope this helps, but please be more specific as to what you want.

The problem:

 void FixedUpdate()
 {
     ray = Camera.main.ScreenPointToRay(Input.mousePosition);
     if (Physics.Raycast(ray, out raycastHitInfo, 10))
     {
         placePos = new Vector3(Mathf.Floor(raycastHitInfo.point.x), Mathf.Floor(raycastHitInfo.point.y), Mathf.Floor(raycastHitInfo.point.z));
         for (int i = 0; i <= 255; i++)<