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:
In the code for the barrel hit detection I make use of ClientCast:ClientCast - A Client-based, Idiosyncratic Hitbox System!
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?