Raycast Hitbox 4.01: For all your melee needs!

V.4.0 Stable

There’s a lot to write about this update, but long story short, the module got a big overhaul. To the way it works and to the way it is written internally. This includes API changes, optimizations, lowered memory usage and of course, new features.

Mesh Deformation

This is one of the major reasons why V.4 took a while to release. A lot of the time was spent optimizing the module to work with bones. There isn’t a lot to really write home about here, it’s quite rudimentary for now since Roblox bones don’t support much functionality. Only SetPoints is supported for Mesh Deformation.

hitbox:SetPoints(bone, {Vector3.new(0, 10, 0), Vector3.new(0, -10, 0)})

Detection Modes

This supersedes PartMode, making it the new way to customize how the module deals with hits. Refer to documentation DetectionModes for more information.

Improved Debug Ray Visualizer Performance

I think the framerate comparisons below say for themselves. RaycastModule relies entirely on the framerate to determine hits, so having the rays not become a bottleneck to that is quite important to me. Hopefully, this will make your debugging sessions easier!

OLD VERSION (Version 3.xx) - Test: 500 Raycast Points (Averages 13.5 FPS)

NEW VERSION (Version 4.0+) - Test: 500 Raycast Points (Averages 59.9 FPS)


Upgrading from 3.xx to 4.0

Please note that V4 is not backwards compatible with V3. There are a few API changes that were introduced in V4 to better suit modern code etiquette. Here are the changes you need to know if you want to make your code compliant with V4:

Changed: Creating a hitbox is now different

  • Removed RaycastHitbox:Initialize
  • Removed RaycastHitbox:Deinitialize
  • Removing Initialize also removed the innate IgnoreList functionalities

Suggested Alternative:

Changed: Method calls to activate certain hitbox functionalities has been removed

  • Removed Hitbox:PartMode
  • Removed Hitbox:DebugMode

Suggested Alternative:

  • Use the aforementioned Hitbox.DetectionMode to set your hitboxes to Default, PartMode, or Bypass
  • Write directly to Hitbox.Visualizer with a true or false to turn on or off the debug rays respectively

Changed: Minor raycastParams name change revision

Changed: Group names no longer support StringValues

  • Hitboxes relying on group names in their attachments no longer uses StringValues

Suggested Alternative


Where to get this new version??!!

The cool kids club:
https://www.roblox.com/library/7034457254/RaycastHitboxV4

The cooler kids club:

Example V4 playground place:
RaycastHitboxShowcaseV4.rbxl (107.4 KB)

72 Likes