I am currently working on a project that contains several different types of collisions, such as punches, explosions, beams, etc. Using parts and creating a listener for the touched event, works fine, until players with poor connection play, then the touched event is never even fired.
For Explosions, it is easy, I will simply get a list of humanoids, check if any are nearby and deal damage.
But for things like punches, which need to have a Cube Hit box, difficult. The cube sizes range from
2x2x2 to 10x10x10. What methods do you suggest for this?
You could use Hitbox:GetTouchingParts() (say, every time you swing your fists). It’s more accurate than .Touched.
However, raycasting is more accurate and is apparently less resource intensive. There’s a module you can find here:
You can easily use fists with this module (people have done it already) and it supports all types of hitboxes. If you’re looking for something simple, that’s the way to go. But if you’re advanced and want to create your own raycasting system, that module is a good place to start.