Delay between ROCK being unachored and being shot [PROJECTILE]

Hello, I’m trying to make this script that puts a rock on top of the players head then goes down while going forward, and then adds a bodyvelocity to the rock that launches it forward; the problem with this is that when I unachor the rock and add the bodyvelocity theres a small delay that I do not want.
https://gyazo.com/86214478955cb812d801b1d3db94c365
the rock goes down and forward then pauses for a bit, then is launched forward. I’d like to get rid of the pause. What I’ve tried is making the bv before the rock goes forward and down and as soon as that ends parenting the bv to the rock, but that did not work.

local Players = game:GetService("Players")
local db = {}

Players.PlayerAdded:Connect(function(plr)
    db[plr] = true
end)
Players.PlayerRemoving:Connect(function(plr)
    db[plr] = nil
end)

script.Throw.OnServerEvent:Connect(function(plr)
	if db[plr] == true then
    db[plr] = false
	ws = plr.Character.Humanoid.WalkSpeed
	rock = game.ReplicatedStorage.TOOLS.Rock:Clone()
	char = plr.Character
	plr.Character.Humanoid.WalkSpeed = 1 
	wait(.5)
	rock.CFrame = char.Head.CFrame * CFrame.new(0,3,0)
	rock.Parent = game.Workspace
	rock.CFrame = rock.CFrame * CFrame.new(0,.4,-0)
	rock.Anchored = true
	r = 0
	bv = Instance.new("BodyVelocity")
	bv.Velocity = char.Torso.CFrame.lookVector * 70
	bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
	repeat
		print(r)
		r = r + 1
		wait(.03)
		rock.CFrame = rock.CFrame * CFrame.new(0,-.4,-1.2)
	until r == 9
	rock.Anchored = false
	bv.Parent = rock
	wait(5)
	   db[plr] = true
	end
end)
1 Like

Caused by the change in network ownership and the code mess. Set up your rock first, then parent it to the Workspace. Furthermore, call SetNetworkOwner on the rock part and pass nil to give the server control over the rock’s physics.

You’ll probably still encounter some kind of delay. Loosely related thread:

And other times this question has been asked:
https://devforum.roblox.com/search?q=delay%20category%3A55

1 Like

Set the P in the BodyVelocity to a really high number (20000 should be good). P is how much effort is put into making the part reach the target velocity, so having it set to high will make it instantly reach that velocity.