MuchachoHitbox: An easy to use SpatialQuery-Based Hitbox System

Introduction

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.

22 Likes

bump ^ this is an amazing resource, personally use a modified version for my projects

2 Likes

This cool, very much likely​:+1::+1::+1::sunglasses:

1 Like

finally, have been using it for a year

1 Like

this hitbox is good, ive been using it since its release

1 Like

Very easy to use, and modify, great for beginner, can be use for multiple purpose. Imo 9/10

I love this! It actually works out of all the other ones i found! (Is it me or I may have been setting up stuff wrong with the other ones)

hey i didn’t even notice this
i might check this out for testing purposes to see if it’s good for my purposes
thank you, SushiMaster :heart: