mouse drag problem

This is just a guess, but try to add or substract hitFirst.point.z from Cue3D.transform.localPosition.z at line 14.