How to snap a Prefab to the normal of an irregular mesh

Hi, I need to have a building follow the mouse, whist snapped to the surface of a low poly Icosphere. Im currently instantiating the prefab at the position of the mouse when hovering over the sphere (using raycasting) but the prefab seems to go crazy and fly towards the camera, rather than snapping to the face / normal of the mesh.

	public GameObject objectPrefab;

	private GameObject currentPrefab;

	Ray ray;
	RaycastHit hit;

    // Update is called once per frame
    void Update()
    {
		if (currentPrefab != null) {
			CurrentPrefabMove ();
		}
    }

	public void PlacePrefab(){
		if (currentPrefab == null) {
			currentPrefab = Instantiate (objectPrefab);
		} else {
			Destroy (currentPrefab);
		}
	}

	private void CurrentPrefabMove(){
		ray = Camera.main.ScreenPointToRay (Input.mousePosition);
		if (Physics.Raycast (ray, out hit)) {
			currentPrefab.transform.position = hit.point;
			currentPrefab.transform.rotation = Quaternion.FromToRotation (Vector3.up, hit.normal);
		}
	}

This is the script which deals with that, any ideas?

I figured it out! Just in case anyone got a similar problem of an object being instantiated at the mouse cursor and using raycasting to snap to an object - make sure to include a check that specifies the tag of the object youre trying to snap to or the raycast will hit the instantiated object, then change its position closer to the camera and then repeat.