I am currently working on a grab system that is used to pick up objects in the workspace, and is held in a tool.
My main issue is that when I attempt to drop these objects, they sometimes get stuck in air if the the players (from what I’ve noticed) character has been idle for a long period of time
I’ve tried to fix this by changing the objects AssemblyLinearVelocity on the server, but that only leads to latency between the player attempting to drop an object to the object actually hitting the ground
here’s my code:
local ServerStorage = game:GetService("ServerStorage")
local GrabTool = ServerStorage.Assets.Tools.GrabTool
return function(player : Player)
local grabTool = GrabTool:Clone()
local function dropObject()
local weld = grabTool:FindFirstChild("Weld")
local object : BasePart
for _, part in pairs(grabTool:GetDescendants()) do
if part:HasTag("Interaction_Object") then
object = part
break
end
end
if object then
object.Parent = workspace
object:SetNetworkOwner(player)
end
if weld then
weld:Destroy()
end
grabTool.Parent = nil
end
grabTool.Unequipped:Connect(function()
dropObject()
end)
grabTool.Activated:Connect(function()
dropObject()
end)
return grabTool
end