Drag detector physics glitches out

the part is supposed to fall upon release however there are some unexpected behaviors
i have it set to geometric, but unanchored so it should fall when let go of part
this is on a client script with drag detector run locally option checked


this video did not help either

my script that i got so far

local object = script.Parent
local drag = object.DragDetector
local blockcast = require(script.Blockcast)

drag.DragStart:Connect(function(player : Player)
	drag.ReferenceInstance = player.Character
end)

--moves the object
drag:SetDragStyleFunction(function(cursorRay : Ray) : CFrame
	return blockcast(cursorRay, drag, object)
end)
return function(cursorRay : Ray, dragDetector : DragDetector, object : BasePart) : CFrame
	local params = RaycastParams.new()
	params.FilterDescendantsInstances = {dragDetector.ReferenceInstance, object}
	params.FilterType = Enum.RaycastFilterType.Exclude
	
	local direction = (cursorRay.Direction).Unit
	local blockcast = workspace:Blockcast(CFrame.new(cursorRay.Origin), object.Size, direction * 1000, params)

	if blockcast then
		return CFrame.new(cursorRay.Origin + direction * blockcast.Distance)
	end
end

test place
blue one is the client and green is the server
client-server.rbxl (58.7 KB)

you can see the part is suspended in mid air however when creating a part, it miraculously comes back down


in the command line i put this to do it, nothing special

local part = Instance.new("Part") part.Parent = workspace part.Position = game.Players.LocalPlayer.Character.HumanoidRootPart.Position + Vector3.new(0, 4, 0)

sometimes the command doesn’t work

1 Like

okay got it to work, just had to set
the object network to the player
i didnt know, i’d automatically assumed that drag detectors would do that

event.OnServerEvent:Connect(function(player)
	object:SetNetworkOwner(player)
end)


client pizza.rbxm (6.6 KB)

Sorry, I did not see this when you posted it. But yes, the solution is to set the network owner to the player. Well done!

1 Like