Object following a point

Here's the deal, I'm trying to make something like a targeting system. I made a ray originating from my chracater going forward, I can adjust the length of the ray with the scroll wheel and when I hold down the mouse button I instantiate a sphere at the end of the ray (indication where I'm targeting). The problem is I can't get the sphere to update it's position as I move my mouse while holding down the mouse button. (it stands still) Would appreciate hot tips.

Make sure you have a handle on the sphere object, and Update it with the position. If your end-of-ray is 'endPoint' then sphereGameObject.transform.position = endPoint; (assuming you got your endPoint in world coords. If not, use Transform.TransformPoint to convert)