Hey everyone. This is my first community post here on the DevForum.
I’m excited to showcase my hitbox module called Muchacho Hitbox – a lightweight, easy-to-use hitbox system built using SpatialQuery and OverlapParams.
Originally, I showcased this on my YouTube channel Sushimaster, but I didn’t have a DevForum account at the time. Now I do, and I’d love to share it with you all.
What is MuchachoHitbox?
Muchacho Hitbox is a hitbox module that supports both box-shaped and sphere-shaped hitboxes using Roblox’s SpatialQuery system.
It’s perfect for:
Melee attacks
AoE abilities
Skill shots
Any gameplay that doesn’t need per-frame accuracy
How to use
To use the MuchachoHitbox module, you first need to require it in your script.
-- To use the MuchachoHitbox module, you first need to require it in your script.
local module = require(game.ServerStorage.MuchachoHitbox)
-- You can create a hitbox using the CreateHitbox function.
local hitbox = module.CreateHitbox()
hitbox.Size = Vector3.new(10, 10, 10)
-- Set the CFrame to wherever you want.
hitbox.CFrame = CFrame.new(0,0,0)
-- You can use .Touched as an event listener for hitbox hits.
hitbox.Touched:Connect(function(hit, humanoid)
print(hit)
humanoid:TakeDamage(10)
end)
-- You can start the hitbox using :Start and stop the hitbox using :Stop.
hitbox:Start()
task.wait(1)
hitbox:Stop()
And yes you can make the hitbox follow an instance by setting the CFrame property to an instance.
hitbox.CFrame = workspace.Part
Documentation
Youtube Video
Here’s a quick showcase of the current version of MuchachoHitbox:
I’d love any feedback or suggestions you might have! Let me know if you run into any bugs or have ideas for improvements.
Hi! I used to use this for my combat game before the velocity prediction update which gave me a huge drawback because it was a fast paced combat game, so I switched over to HitboxClass. But with this new velocity prediction update I ended up switching back to MuchachoHitbox because I realized it detected hits faster than HitboxClass and now it has velocity prediction which is pretty neat.
I am currently making a Horror Asymmetrical Roblox game where there is 1 killer and 4 survivors, and I’m using your module to replicate the Dead By Daylight killer lunge hit detection. As of right now, it works almost perfect as it feels fair for both the killer and survivor(s) who get hit. Although there is an exception where the killer is lunging at double the walk speed and turns their character around quickly, the hitbox’s velocity prediction is still delayed, but this time only when turning your camera in quick succession. I did try circumventing the issue by increasing the VelocityPredictionTime, but now it just feels unfair to hit a survivor as a killer when they’re pretty far away. Is there a way to predict how fast the player is turning their camera/character and have the hitbox be predicted turning sideways?
I don’t think it’s possible to make the hitboxes feel accurate to the characters using velocity prediction alone. If you want the hitbox too feel like it’s moving smoothly with the character I suggest you use client sided combat with safety checks.
But here’s something really interesting that I only just found out recently, the fast paced anime combat game ABA doesn’t make the hitbox follow the character. It creates the hitbox and it stays in the same position. It might seem counter intuitive but making the hitbox stay in place could be a good idea as well.
in the types module you have CFrame of hitbox set to be only a CFrame and not a part which your module does support, this seems kind of like a niptick and it is but for us strict users it gets on the nerves so you should probably add | BasePart