Clunky Mouse Follow

I’m making a script so that you can place items in a level. Currently, I have the following script:

 var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
 var hit : RaycastHit;
     if (Physics.Raycast (ray, hit, 100)) {
       Debug.DrawLine (ray.origin, hit.point);
       movingObject.transform.position = Vector3(hit.point.x,hit.point.y,0);
     }

Now, this works almost perfectly, but it is very clunky. By that I mean the object shakes all over the place and does not move smoothly, especially when moving the mouse down. Is there a better way I could be doing this?

It was because there was a collider on the object. Simple fix.