Currently, I’m trying to make an item throwing system. How it currently works is that you have a tool, and you hold down a button to charge up. Once you let go, it deletes the tool, finds the corresponding model in ReplicatedStorage, and clones that model. After that, I am applying a LinearVelocity to the part, but the part freezes in midair for a second before it applies. Is there any fix to this physic delay?
Relevant Code (ignore For Loop, that’s for another part of the system)
event.OnServerEvent:Connect(function(player, tool, strength)
local object = objects:FindFirstChild(tool.Name):Clone()
object:AddTag(“Pickup”)
local continue = true
for i,v in player:FindFirstChild(“HeldObjects”):GetChildren() do
if v.Value == objects:FindFirstChild(tool.Name) and continue == true then
continue = false
v.Value = nil
end
end
object.Parent = workspace
object.Position = player.Character.PrimaryPart.Position + player.Character.PrimaryPart.CFrame.LookVector * 3
tool:Destroy()
local attachment = Instance.new(“Attachment”)
attachment.Parent = object
local velocity = Instance.new(“LinearVelocity”)
velocity.Parent = attachment
velocity.Attachment0 = attachment
game.Debris:AddItem(attachment, 0.1 * strength)
velocity.VectorVelocity = player.Character.PrimaryPart.CFrame.LookVector * (strength + 3) * 10end)