How do I take the mouse's moving position and convert it to world position?

I did exactly as you said. But the sphere collision is still not right under the mouse cursor. When I do not press the left mouse button and just move it around, I move the sphere collision with the mouse cursor, this is very nice, this is what I want. There’s only one thing left: the sphere collision should be exactly under the mouse cursor, not near or far from it.