Linear Velocity Lag?

This is my first time using linear velocity as a method for projectiles and just in general and I’ve ran into a problem. Currently I’m trying to use linear velocity to throw a snowball to my mouse cursor. However, the snowball lags sometimes when I’m throwing it and I have no idea why. It’s a cloned snowball part that I’m throwing forward, so I don’t know if it has anything to do with it.

I’ve also realized that it only happens for a while when I join the game. I think the problem goes away after a while, but it seems like when I throw the snowball when I’m new to the server it lags a bit.

Snowball Part Lag

No SnowBall Lag


local function SnowBallEquipped(LocalPlayer, active, mouse)
	local Character = LocalPlayer.Character
	local Humanoid = Character:WaitForChild("Humanoid")
	local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
	local LookVector = Character:WaitForChild("HumanoidRootPart").CFrame.LookVector

	if active == true then
		local SnowBall = ReplicatedStorage:WaitForChild("SnowBall")
		local Box2 = ReplicatedStorage:WaitForChild("Box2")
		local Box3 = ReplicatedStorage:WaitForChild("Box3")
		local Animation1 = Humanoid:LoadAnimation(Animation.Create)
		local SnowBallClone = SnowBall:Clone()
		local Box2Clone = Box2:Clone()
		local Box3Clone = Box3:Clone()
		local SnowBallSpawnSound ="Sound", SnowBallClone)
		SnowBallSpawnSound.SoundId = "rbxassetid://9125640609"
		SnowBallSpawnSound.RollOffMaxDistance = 100
		SnowBallSpawnSound.Volume = 7
		SnowBallSpawnSound.Name = "SnowBall Spawn"
		SnowBallClone.Parent = game.Workspace
		Box2Clone.Parent = SnowBallClone
		Box3Clone.Parent = SnowBallClone
		local MagicChimeSound  ="Sound", Box2Clone)
		MagicChimeSound.SoundId = "rbxassetid://9116394876"
		MagicChimeSound.RollOffMaxDistance = 100
		MagicChimeSound.Volume = 7
		MagicChimeSound.Name = "Snowball Chime"
		local SnowBallTween =, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
		local SnowBallProp = {Size = SnowBallClone.Size +,0.8,0.8)}
		local SnowBallCreate = TweenService:Create(SnowBallClone, SnowBallTween, SnowBallProp)
		SnowBallClone.Position = HumanoidRootPart.Parent.RightHand.Position +,3,0)
		Box2Clone.Position = SnowBallClone.Position +,0,0)
		Box3Clone.Position = Box2Clone.Position +,0,0)
		SnowBallClone.Anchored = true
		local distance = (SnowBallClone.Position - HumanoidRootPart.Parent.RightHand.Position).Magnitude
		SnowBallClone.Anchored = false
		local LerpSound ="Sound", SnowBallClone)
		LerpSound.SoundId = "rbxassetid://9126284551"
		LerpSound.RollOffMaxDistance = 100
		LerpSound.Name = "Lerp Sound"
		LerpSound.Volume = 100
		local function lerp(a,b, t)
			return a + (b-a) * t
		for i = 0, distance, 1  do
			local t = i/distance
			SnowBallClone.Transparency = 0
			SnowBallClone.Position = lerp(SnowBallClone.Position, HumanoidRootPart.Parent.RightHand.Position, t)
		local newWeld ="Weld", HumanoidRootPart.Parent.RightHand)
		newWeld.Part0 = HumanoidRootPart.Parent.RightHand
		newWeld.Part1 = SnowBallClone
		newWeld.C0 =
		newWeld.C1 =
	elseif active == false then	
		local Throw = Humanoid:LoadAnimation(Animation.Throw)
		local WeldC =  HumanoidRootPart.Parent.RightHand:FindFirstChild("Weld")
		local SnowBallC = game.Workspace:FindFirstChild("SnowBall")
		local LinearVelocity ="LinearVelocity", SnowBallC)
		local Attachment ="Attachment", SnowBallC)
		LinearVelocity.Attachment0 = Attachment
		LinearVelocity.VectorVelocity = (SnowBallC.Position - mouse).Unit * -100
		LinearVelocity.VelocityConstraintMode = Enum.VelocityConstraintMode.Vector
		LinearVelocity.MaxForce = 10000
		LinearVelocity.RelativeTo = Enum.ActuatorRelativeTo.World

		local ThrowSound ="Sound", HumanoidRootPart)
		ThrowSound.SoundId = "rbxassetid://608600954"
		ThrowSound.Volume = 5
		ThrowSound.Name = "Throw Sound"
		ThrowSound.RollOffMaxDistance = 100
		Debris:AddItem(ThrowSound, 2)


I don’t see anything particularly wrong with your code, however I do have a few ideas on why this is happening.

Like you said, it only happens at the initial loading time of the player; Maybe ROBLOX’s physics engine is not yet initialized.

Though, I would recommend when making objects move; that you move them using RunService if you want them to move regardless of the current FPS of the client.

In this case you should use Runservice.Heartbeat for a physics operation.

Additional help: RenderStepped, Stepped, or Heartbeat