hey! so, I’ve been making a movement shooter, which means it’s a shooter but sometimes players go REALLY fast, and that is taking a toll on the hit registration reliability
for the hitbox framework, i tried using this code to sanitize the registration
local part:Part = HitParts[index]
local HitPosition = HitPositions[index]
local Distance = HitDistances[index]
local HitToPartDirection = (part.Position - HitPosition).Unit / 3
local OffsetHitPosition = HitPosition - HitToPartDirection
-- validation raycasts
local ClientPositionValidation = workspace:Raycast(TorsoPosition, (Player.Character.Torso.Position - TorsoPosition).Unit * 100)
local TargetPositionValidation = workspace:Raycast(OffsetHitPosition, HitToPartDirection * 10, param)
local validChecks = 0
-- validation checks
if (ClientPositionValidation and ClientPositionValidation.Instance:IsDescendantOf(Player.Character)) or (Player.Character.Torso.Position - TorsoPosition).Magnitude < 10 then
validChecks += 1 else warn("clientPos fail")
end
if TargetPositionValidation and TargetPositionValidation.Instance:IsDescendantOf(part.Parent) then validChecks += 1 else warn("targPos fail") end
the clientPos seems to work reliably, but for the target, it seems to always fail if the target is moving quickly, and i dont exactly know why, and i need some help
some extra suggestions on how to sanitize it even more would also be helpful!