RaycastHit always returns 0

I’m trying to move a blood prefab (a decal) to an enemy’s feet when they die. The old script I had (commented out in the Start() function) simply drops the y coordinate to 0. However, I want to use raycasting to drop the prefab to the nearest collider, within 2 units. Otherwise, the prefab should be destroyed.

using UnityEngine;
using System.Collections;

public class PuddleDown : MonoBehaviour
{

    // Use this for initialization
    void Start()
    {
        //transform.position = new Vector3(transform.position.x, 0, transform.position.z);
    }
    void Update()
    {

        RaycastHit floor;

        Vector3 down = transform.TransformDirection(Vector3.down);

        if (Physics.Raycast(transform.position, down, 2))
        {
            transform.position = new Vector3(floor.point.x, floor.point.y, floor.point.z);
        }
        else
        {
            Destroy(gameObject);
        }
    }
}

The problem is that floor.point is always 0, no matter where the AI is. I don’t use raycasting a lot and I have no idea why this is happening. Can someone help me?>

It is because you have declared RaycastHit floor variable but you are not assigning value to it from the Raycast itself. This might help:

if (Physics.Raycast(transform.position, down, out floor, 2))