Help with making this dragging less janky and weird

hey so im making this dragging system for a game and its just super janky with how it functions. I have tried the drag constraints but they dont really work in a way thats applicable. The goal is to make it both smoother and also so it collides with other objects while being dragged. Heres the code and a video of what happens

Server:

game:GetService('ReplicatedStorage').MoveItem.OnServerEvent:Connect(function(plr, item, position)
	item.Position = position
end)

Client:

local dragging = false
local plr  = game:GetService('Players').LocalPlayer
local item = nil

game:GetService('RunService').Heartbeat:Connect(function()
	local mouse = plr:GetMouse()
	mouse.TargetFilter = plr.Character
	if not item and mouse.Target and mouse.Target.Parent then
		item = mouse.Target
	elseif item and item.Parent and item:FindFirstChild('Draggable') and dragging == true then
		if item:IsA('BasePart') then
			if (item.Position - workspace.CurrentCamera.CFrame.Position).Magnitude > 20 then
				local pos = workspace.CurrentCamera.CFrame.Position + workspace.CurrentCamera.CFrame.LookVector * 20
				item.Position = pos
				game:GetService('ReplicatedStorage').MoveItem:FireServer(item, pos)
			else
				local pos = workspace.CurrentCamera.CFrame.Position + workspace.CurrentCamera.CFrame.LookVector * 10 
				item.Position = pos
				game:GetService('ReplicatedStorage').MoveItem:FireServer(item, pos)
			end
		end
	elseif dragging == false then
		item = nil
	end
end)

plr:GetMouse().Button1Up:Connect(function()
	dragging = false
end)

plr:GetMouse().Button1Down:Connect(function()
	dragging = true
end)

Explorer:

Video:
https://youtu.be/WExFHENLPmc (if video isn’t there wait a minute for it to upload)

Have you tried using roblox’s built in drag detector?

yeah i cant seem to get it to work properly for what i want though because the max range parameters are in a square and not a sphere and it also looks very laggy because of how slowly it updates

heres what it looks like vs drag detector https://youtu.be/1wvvq1xmLuU

have you tried to use something from this post?