#problems with hit detection

1 messages · Page 1 of 1 (latest)

rich spindle
#

Hi, I've been working on my fighting game for a bit now and I've run into a weird bug. I'm trying to make Ultra Instinct Goku into a playable character but I ran into some trouble with his LMB punching attack. At first, it works like normal and deals damage when opponents are touched by the hitbox and it can even be spammed so it can go faster, but after a bit of spamming, the attack no longer deals damage and the player has to wait before being allowed to throw only 2 punches before needing to wait again. I didn't incorporate any type of cooldown in a way that takes into account how many punches the player has thrown, only a 0.1s cooldown between separate punches. I have no idea what could be causing this but with some print statements, I at least know it has to do with the "hitbox.Touched:Connect" part of the attack. If anyone could help me out, it would be super... helpful, so let me know how I can fix this so I don't make a similar mistake in the future.

hexed sierra
#

try looping through hitbox:GetTouchingParts() instead of .Touched connection, should be more reliable

#
for _, hit in hitbox:GetTouchingParts() do
    module.hit(hitbox, hit, player)
end

hitbox:Destroy()
#

also why would you not anchor it and weld it to hrootpart?

#

You can miss but walk into a foe and damage him very mysteriously

#

also exploiters can just teleport to everyone so they are hit before the hitbox gets destroyed