So I’m having a pretty big issue where if your over 150 ping / the person your fighting is then body movers just refuse to work. I’ve asked around a lot and no one really know how to make them not so ping based. The gifs below show what I mean, sometimes its even worse since I’m replicating with modest ping.
How a basic combo is supposed to look:
How it actually looks when in a medium/high ping range (Usually much worse than this):
Example of how a skill is supposed to work:
How the skill actually looks:
Mover creator module:
local module = {}
function module:createBodyPosition (position, multiplyer, parent, name)
local body_position = Instance.new("BodyPosition")
body_position.Name = name
body_position.Parent = parent
body_position.MaxForce = Vector3.new(10^4.5,0,10^4.5)
body_position.Position = position * multiplyer
return body_position
end
function module:createBodyVelocity (velocity, multiplyer, parent, name)
local body_velocity = Instance.new("BodyVelocity")
body_velocity.Name = name
body_velocity.Parent = parent
body_velocity.MaxForce = Vector3.new(10^4.5,10^4.5,10^4.5)
body_velocity.Velocity = velocity * multiplyer
return body_velocity
end
function module:createBodyGyro(cframe, D, P, parent, name)
local body_gyro = Instance.new("BodyGyro")
body_gyro.Parent = parent
body_gyro.Name = name
body_gyro.D = D
body_gyro.P = P
body_gyro.MaxTorque = Vector3.new(0, 10^4.5, 0)
body_gyro.CFrame = cframe
return body_gyro
end
return module
One of my velocity segments:
function module.takeKnockback(amount, length, attacker_root, target_root, shockwave, offset)
coroutine.wrap(function()
local direction
if not shockwave then
direction = attacker_root.CFrame.LookVector
elseif shockwave then
direction = (target_root.Position-attacker_root.Position).Unit
direction = direction + offset
end
if offset then
direction = direction + offset
end
local enemyKnockback = mover_module:createBodyVelocity(direction, amount, target_root, "dashVelocity")
debris:AddItem(enemyKnockback, length)
if players:FindFirstChild(target_root.Parent.Name) then
wait(length - 0.05)
if not players:FindFirstChild(target_root.Parent.Name) then return end
combat_remote:FireClient(players:GetPlayerFromCharacter(target_root.Parent), 2, enemyKnockback) -- This removes the mover on client to attempt to help with velocity flinging you at high ping
end
end
end)()
end
All code is on server, everything works perfect under 100 ping and starts getting rough around 150. There’s a lot of other fighting games with the same type of skills/combat that don’t have this problem and I really just can’t figure out how they did it. Any help?