Move 3D object with mouse and precision

Godot Version

4.3

Question

I’m trying to move a 3D object with the mouse and it works! However, the accuracy is terrible, note that both the object and the mouse are far away and the distance between them increases even more.

Video 1

I would like to move with greater precision, where the mouse is always centered with the object.

Here’s my code:

	if event is InputEventScreenDrag:
		$Cube.translate(Vector3(event.relative.x , 0,  event.relative.y) * 50 * 0.001)

Raycast into the scene instead from the view to the mouse and move the object to that hit position.