Raycast Hitbox 4.01: For all your melee needs!

Not at the moment. I am currently working with another developer on an automated solution that will place attachments on a face automagically. No ETA on this yet since I am currently reviewing the best way to go forward with this while minimizing code bloat.

1 Like

looking forward to that if it comes to be!

You have any functions laying around to create an array of DmgPoints on a part by simply passing in the part and resolution of points desired?

That’s exactly the system that is being implemented. I will need to follow up with the other developer helping me implement it to RaycastHitbox before I do so but it does that with a resolution setting.

Unfortunately, I don’t have a function right now that I can give you :stuck_out_tongue:

1 Like

I remember seeing a reply with a custom function for this exact purpose. I’ll edit when I find it.

Here it is:

1 Like

Bruh :weary:

That is so useful! Thank you! I was trying to do it myself and it took me many more lines :stuck_out_tongue:

Now i wish i can get this to work on a sphere!

1 Like

I dont think this is your problem, but you have way more attachments than you need for that sword.

I already have an attachment in my melee weapon called grip, it grips the weapon somewhere, wouldn’t grip be placed in the hitbox therefore every attachment in the tool is a hitbox?

The module only searches for attachments with a given name. Default is “DmgPoint”. You can change this in the script. The attachment name “Grip” isn’t “DmgPoint” so it won’t be part of the hitbox.

1 Like

My hitboxes are delaying and even sometimes not landing. Do you have any idea why?

Clearly the first hit made contact, but it did nothing. This is a huge recurring problem that messes up the entire combat system. vvv
https://i.gyazo.com/308e6d87d881e98ef3274028338e92ba.mp4

Is this on the server? If it is, this is called latency. I provided more insights here on why it lags:


Also is this on the most recent version of Raycast Hitbox? I’ve recently fixed an accuracy issue in 4.01.

When was 4.01 released? I just began work on this system a few days ago.

Also, wouldn’t having damage on the client make it easily exploitable?

1 Like

Check the main post for 4.01, it has a date on it. Redownload it just in case.

Search this thread on sanity checks. I went over numerous examples with numerous developers about it. It’s not exploitable if you make your checks bullet proof.

Hi, trying to set up a blacklist and I receive the error: Argument 1 missing or nil
When I click to go to the code it appears to be complaining about ‘newHitBox’(see code below) which makes no sense:

local newHitbox = RaycastHitbox.new(Handle.Mesh)
newHitbox.RaycastParams = RaycastParams.new()
newHitbox.RaycastParams.FilterDescendantsInstances = Player
newHitbox.RaycastParams.FilterType = Enum.RaycastFilterType.Blacklist

with out the Params setup the hitbox is created and works.

newHitbox.RaycastParams.FilterDescendantsInstances

Should be a table.

newHitbox.RaycastParams.FilterDescendantsInstances = { Player}

Hello, I need some help.

Is there a way for the hitbox to detect even if the attachments arent moving?
It appears the hitbox will only work if a part is moving…

I had the same problem last time.

if your way of detecting is

hitconnection.OnHit:Connect(function(hit, hum)
if hit.Parent:FindFirstChild("Humanoid") then
--code here
end
end)

Then you will experience delay

so you should change it to :

hitconnection.OnHit:Connect(function(hit, hum)
if hum then
--code here
end
end)

and check if it fixes your problem!
(also make sure that your hitbox module is client-sided)

No, it only works if you are moving. Raycasts requires distance for it to detect hits. The raycasts does not have a set width and therefore equals to zero distance if you are not moving.


Another developer here used the LinkAttachments function here to circumvent that issue since it allows hitboxes even while stationary.

1 Like

Good to know!
Thank you for the fast response too!

I have placed the hitbox code into my sword script and it is working ok, but is this a good practice? Should I have the definitions for the hit box in another script so it can be assigned as needed to different weapons and just set a call to the needed weapon script in the script that defines the hitbox?