-
What do you want to achieve?
I want to stop the wobble effect from the runService -
What is the issue?
https://gyazo.com/de2b05804431bdffc7ebf8aa2bc935d6
As you can see there, the player is like very lagging and can cause some bugs -
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)