Any ideas for better hit detection?

Right now I have a hit detection system that runs perfectly fine, but I feel like would be server intensive in high player servers. As of right now I’m using a while loop in order to create multiple hitboxes until I set the loop to false.

Any other creative ideas for hit detection? I’m open to all ideas really, as I really haven’t tried anything else.

EDIT: By hit detection I mean melee hit detection, sorry for any confusion : P

1 Like

What do you mean by “hit detection”? Do you mean like detecting if a bullet hits something or if two players collide?

More like two players colliding, if you want me to be more specific it could be considered among the lines of melee hit detection.

There’s a thing called BasePart.Touched

There’s RaycastHitbox and FastCast module that you can use

Did you search before posting?

Your OP doesn’t make sense either, we don’t understand what you want if you don’t provide us code

Two players colliding? Can technically be triggered using the .Touched function, there are probably more ways though. Like @RuizuKun_Dev said

1 Like

.Touched is easily exploitable considering this is collision between two players, leading to easy exploitation of network ownership.
For the rest I agree, OP needs to be more detailed on what they want.

Yeah I’ve had my fair sure of .Touched use in the past but I’ve come to not like it so much as other methods, it’s unresponsive and if you ask me should only be used in part with region3 or .magnitude.

Also, I don’t really wanna use modules that I haven’t made myself. Just trying to further expand my knowledge, but thanks for listing those modules; I’m definitely going to take a look at their inner framework.

What method do you currently use?

As of recent I’ve just been using my own rotated region3 module to detect anyone within the hitbox using a while loop that iterates for as long as the melee animation is playing.

Unsure how efficient that would be, considering you probably grab every players basepart and do math with it(?).
My hitbox module uses rays and creates a net-like structure, spanning across the part.
This is how it looks:
image
Side view:
image

It goes in a staircase-shape, each ray going down by one level from top to bottom of the part, thus covering as much of the part as possible with the slightest amount of rays.

4 Likes

Wow that’s creative I’ll give it a shot.

Thanks for the replies.