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
Setup
Place the HitboxSettings folder in ReplicatedStorage
Add the following object values to the settings folder:
Alive Folder: Reference to the folder containing all alive characters
Ignore Folder: Reference to the folder where the hitbox will ignore
Velocity Constant: (Optional) Numeric value for velocity calculations (default: 6)
Usage Examples
Basic Hitbox
local Hitbox = require(path.to.Hitbox)
local hitbox = Hitbox.new({
InitialCframe = character.HumanoidRootPart.CFrame,
SizeOrPart = Vector3.new(5, 5, 5),
Debug = true
})
hitbox.OnHit:Connect(function(hitCharacters)
for _, character in ipairs(hitCharacters) do
local humanoid = character:FindFirstChildOfClass("Humanoid")
humanoid:TakeDamage(10)
end
end)
hitbox:Start()
-- When done:
hitbox:Destroy()
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