Best method for hitbox detection?

What is the best method for consistent and realistic hitboxes? I’ve been trying to create a more in depth combat (stuns, parries, heavies, aerials, etc) and so far I’ve been using magnitude to check for the distance in between my player & the target player, and raycasting to make sure I can’t hit players behind / to the side of me without actually facing them, however at the same time this prevents me of being able to hit people from certain angles and overall does not seem efficient. Any recommendations?

2 Likes

I usually check it with part:GetTouchingParts().
What i do is fire a remote function from server to client that returns touched parts in a table, checking if that kind of hit is possible with magnitude (just incase player has ping) then doing what i want.

Theres a handful of neat ways people have tackled hitbox shenanigans. Depending on what you’re doing and how you’re going about it, Region3 might be your friend for generally more accuracy at funky angles.
For the purpose of this, maybe check out Rotated Region3 if you haven’t, as a module itself it proves super useful, and if you’re keen on developing your own method, its a good place to start also.
As for an alternate approach using raycasting, Raycast Hitboxes seems quite neat.

The first one is my go-to in terms of methods used outside of basic :Touched events for simpler needs. But the second one seems to be quite robust also.

1 Like

If you looking for dynamic and accurate raycasting You can use this module for raycast

2 Likes

I’ll be sure to give these methods a go and see which one works out for me. The module seems pretty neat in particular, thank you for the feedback.

1 Like