the trace start on the trace hit result, or the world location on the convert mouse location to world space is the cursor’s actual world location, not what you clicked on, the grab distance thing is unrelated (i just check how far away the clicked object was from the cursor when it was clicked so it stays at that distance)
I had these screenshots lying around, they had all the code you seemed to need.
Is this what you wanna do?