I’ve always been a bit skeptical in trusting collisions between a part and the player, as it can be very simple, yet so tedious . Making melee weapons should be very easy, but how can i certainly provide a strong, effecient way to do this?
– this is just kinda a chat thing i just want to know how people do this sort of stuff –
EtNowis
(EtNowis)
April 20, 2025, 10:04am
#2
if the hitbox ‘open’ only once in the animation, we can use workspace:GetPartBoundsInBox, GetPartBoundsInRadius or other shape casts to act as the hit box
trigophi
(trigophi)
April 20, 2025, 11:34am
#3
Take a look at the post (and specifically its replies) below.
Hello all.
I’ve recently been deliberating in regards for the best solution for my game’s hitbox system - I had issues finding the solution for the most efficient, easy-to-setup, ping friendly, and exploit-proof system.
After talking it through with some friends and other experienced developers, I believe I’ve found a solution which fits all of the criteria met above.
I’ll firstly explain the theory behind it - after all, how can you use something properly without fully understanding the unde…
Raycasting is fine for hit detection. Raycasting from multiple points. This is how games like Mordhau and Chivalry do their hit detection.
For general collision detection that needs accurate physics(not just orientated bounding boxes), GetTouchingParts is your best bet for reliability. TouchEnded doesn’t always fire so using it to keep track of collisions is not great.
I personally wouldn’t GetTouchingParts just for hit detection for a sword or something though, since again raycasts are more suited and less costly for the task.
So, yeah, if you haven’t already, I’d recommend checking out raycasting and if it works for what you aim to accomplish: Raycast Hitbox 4.01: For all your melee needs!
Other than that, I don’t have enough experience to tell you what the “most efficient” method is.
Thanks alot man, i appreciate it
1 Like