When testing my Donkey Kong game, I came to the conclusion that the hit box of fast moving barrels came earlier than the barrels as you can see in the video:
local clientCast = require(game.ServerStorage.ClientCast)
for j =-2.099,2.143,1 do
local attachment = Instance.new("Attachment",script.Parent.Union)
for i = -2.099,2.143,.1 do
local attachment = Instance.new("Attachment",script.Parent.Union)
attachment.Name = "DmgPoint"
attachment.Position = Vector3.new(i,j,0)
end
end
local caster = clientCast.new(script.Parent.Union, RaycastParams.new())
local db = {}
caster.HumanoidCollided:Connect(function(result,hithumanoid)
if db[hithumanoid] then return end
db[hithumanoid] = true
hithumanoid:TakeDamage(25)
wait(0.01)
db[hithumanoid] = false
end)
caster:Start()
I have no clue how to fix this…
I’ve got a ping of 70ms
Any Ideas?
It’s very difficult to understand everything that is happening in this scene.
Are you using the .Touched event for getting hit?
What does your ping look like (ctrl+alt+F7)?
If you are using .Touched then it looks like your barrels are simply lagging which may be because of how many physics objects and server scripts there are. Using SetNetworkOwner on the barrels might help in that case. It’s hard to say without much more information.
Yeah, that seems to be the case. Since the client handles network replication of it’s own character, you may see yourself jumping instantly, but the replication would be delayed by 100-200ms on the server.
The network ownership being set to the client means the client can change the barrel’s position or add velocity/remove velocity whereas on the server it can’t do anything unless the network owner is set to nil.