How can I stop the wobble effect?

  1. What do you want to achieve?
    I want to stop the wobble effect from the runService
  2. What is the issue?
    https://gyazo.com/de2b05804431bdffc7ebf8aa2bc935d6
    As you can see there, the player is like very lagging and can cause some bugs
  3. What solutions have you tried so far?
    I have tried to use weld, but I ended up very very bad, the cop can’t even jump.

Here is the code:

grabbed.OnServerEvent:Connect(function(plr, run, enemyChar)
	local plrHrp = plr.Character:WaitForChild("HumanoidRootPart")
	local enemyHrp
	if enemyChar ~= nil then
		enemyHrp = enemyChar:WaitForChild("HumanoidRootPart")
	end 
	
	grabbing[plr] = run
	if run then
		enemyChar:WaitForChild("Humanoid"):ChangeState(Enum.HumanoidStateType.PlatformStanding)
		
		playerGrabbed[plr] = enemyChar
		loops[plr] = runSvc.Heartbeat:Connect(function()
			enemyHrp.CFrame = plrHrp.CFrame * CFrame.new(1,0,-2)
		end)
	else
		enemyChar:WaitForChild("Humanoid"):ChangeState(Enum.HumanoidStateType.RunningNoPhysics)
		
		if loops[plr] ~= nil then
			loops[plr]:Disconnect(); loops[plr] = nil
			grabbing[plr] = nil
		end
	end
end)

You need to run this code on each client, instead of on the server, where you have 1 round-trip-time delay in lag.

I think Heartbeat is fine here.

1 Like