How to move 3d cube with mouse (Godot 3.0)?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By damncoder
:warning: Old Version Published before Godot 3 was released.

I have a 3d cube, and i want to move it with mouse cursor. All i find about this topic its a raycasting example:

var ray_origin = camera.project_ray_origin(get_viewport().get_mouse_position())
var ray_direction = camera.project_ray_normal(get_viewport().get_mouse_position())
var from = ray_origin
var to = ray_origin + ray_direction * 1000.0
var space_state = get_world().get_direct_space_state()
var hit = space_state.intersect_ray(from, to)

But it did not help me in solving the problem. Any ideas?
I found function “camera.project_position()”, but i didnt understand how it works…

Thanks in advance.