Using RayCasts properly

I am currently trying to solve what I thought was a fairly simple problem but it is turning out to be a little harder than I thought. All I am trying to do is move a game object towards a large sphere (which is centered at the origin). Once the sphere is within a set distance of the sphere it Instantiates another game object in it’s current position and destroys itself. This current code isn’t doing the trick for me and I wanted to see if I could get some help. Let me know that you think.

One thing to note, I am currently never hitting the current print statement.

public class NavPointGen : MonoBehaviour {
    	public float offPlanet = 5.0f;
    	private Vector3 originP = new Vector3 (0.0f, 0.0f, 0.0f);
    	public float fallSpeed = 3.0f;
    	public GameObject navNode;
    	public void FixedUpdate() 
    		transform.position = Vector3.MoveTowards (transform.position, originP, fallSpeed * Time.deltaTime);
    		RaycastHit hit;
    		Ray center = new Ray (transform.position, originP);
    		if (Physics.Raycast(center, out hit))
    			print ("Hit!");
    			if(hit.distance <= offPlanet)
    				GameObject finalNavNode = Instantiate(navNode, transform.position, Quaternion.identity) as GameObject;
    				finalNavNode.transform.parent = GameObject.Find("NavMap").transform;

Rays are constructed using a position and a direction. You are using two positions in constructing your Ray. Instead:

Ray center = new Ray (transform.position, originP - transform.position);

Note there is a form of Raycast that takes a position and a direction rather than a Ray. On line 16, you could do the following and not construct a Ray at all:

if (Physics.Raycast(transform.position, originP - transform.position, out hit))