In NODE3d , hold onto to an object and release using mouse

Godot Version

4.21

Question

im currently trying out hold on to an object and move around using my mouse
how do i click the object and hold on to it

extends Node3D

func _0n_ridigbody_input_event(camera,event,click_position,normal,shape_idx):
if event.is_action_pressed(“mouse_click”):
if event is InputEventMouseMotion:
var newP = Vector3(click_position.x,click_position.y,0)
#set_position(newP)

			print("set position is ",newP)
			print("Viewport Resolution is: ", get_viewport().get_visible_rect().size)

pass