A flexible, high-performance hitbox system for Roblox games that supports both server and client-side hit detection with advanced features like hit point detection, velocity prediction, and comprehensive debugging tools.
Server and client-side hit detection - Choose the best approach for your game
Precise hit point detection - Get exact collision positions, normals, and materials
Multiple hitbox shapes - Support for box, sphere, and custom part shapes
Flexible target detection - Detect humanoids, objects, or both
Velocity prediction - Compensate for fast-moving hitboxes
Visual debugging - See your hitboxes in real-time
Advanced Features
High performance - Optimized spatial queries and caching
Configurable parameters - Debounce time, lifetime, and more
Blacklist support - Exclude specific instances from detection
Signal-based events - Clean, reactive hit detection system
Proper cleanup - Automatic memory management and resource cleanup
Easy integration - Simple API that works with any Roblox game
Usage Examples
Factory methods for common use cases:
-- Sphere hitbox
local hit = Hitbox.sphere(10, CFrame.new(0, 5, 0))
-- Box hitbox
local hit = Hitbox.box(Vector3.new(10, 5, 10), CFrame.new(0, 5, 0))
-- From existing part
local hit = Hitbox.fromPart(workspace.MyHitboxPart)
Full constructor with sensible defaults:
local hit = Hitbox.new({
Size = Vector3.new(10, 10, 10), -- Only required field
CFrame = CFrame.new(0, 5, 0), -- Optional, defaults to origin
DebounceTime = 0.5, -- Optional
Lifetime = 5, -- Auto-destroy after 5 seconds
Debug = true, -- Show visualization
AutoStart = true, -- Start immediately
Tag = "Enemy", -- Optional CollectionService tag filter
})
it is performant as long as you are following best pratices. e.g destroying when not being used. I do plan on simplifying the client hitbox creation as it can be a bit confusing rn
This EZ hitbox module saved my studio from shutting down. It cured my depression, shaved my cat, and made me more money than grow a garden on a saturday morning. I can’t recommend this modular EZ hitbox enough. I think every developer needs this as it will change the trajectory of their roblox careers