Raycast Hitbox 4.01: For all your melee needs!

I couldnt find it? can you show it to me?

The bottom of this post contains the new APIs, basically, you just need to switch out the old methods with the new ones. It shouldn’t take too long.

1 Like

so since:

  • Removed RaycastHitbox:Initialize
  • Removed RaycastHitbox:Deinitialize

got removed do I have to:

RaycastHitbox.new
Hitbox:Destroy?

When I use this for melee with Default Detection, it doesn’t hit player’s torso and head, because of accessories, is there a way to fix it?

1 Like

Look. Just make a server-sided script that will change accessory’s size to (0.05, 0.05, 0.05). It’s the easier way to deal with most of “ghost-hits”.

Hi, I have a basic combat system no melee, how can I implement this module instead of using a big hitbox on the hands for punching.

1 Like

This is a smart method though, Thanks!

1 Like

I have a hitbox set up that creates the hitbox and starts it when a remoteevent fires but once it hits and disables the hitbox, another firing of the remote doesn’t create the hitbox.

Seems like errors get eaten in the OnHit:Connect callback (making it difficult to debug)

Here’s an example where I explicitly throw an error in the callback:
RaycastHitboxNoError.rbxl (43.0 KB)

The module looks great! I’ve run into a problem, however, and I’m unsure of how to fix it.

I used your intermediate tutorial to make hitbox points along my character’s arms for a punching attack activated whenever “E” is pressed. The script on my end works fine, however, I get this error from the Vector3 script in the module.

Here’s the line the error stems from.

I imagine a possible reason for this error is because my script is a local script in StarterGui, but again, I’m unsure. Please let me know if you have any solutions to this error!

EDIT : Nevermind, it works fine! I corrected a mistake with what I set the hitbox points to and the problem is gone.

Well done! Works perfectly for punching/kicking which I had first worried about and is a great way to start of your own customized Raycast Hitbox script.

Suppose I’ve created a part and I create a hit-box using a script parented to this part, and I later destroy the part with :Destroy(), do I need to disconnect OnHit when I do that or does the module handle this for me automatically?

I’m wondering, does this compatible with the leaderboard script? (making creator value)
because my melee that use raycast hitbox v4 does not work with the leaderboard script, i tried using creating creator value like the normal weapon did, but it still doesn’t work. but the leaderboard script work with classic sword and etc. im pretty sure it the melee problem not the leaderboard.

Been having quite a bit of trouble with this lately, Im trying to figure out how I can blacklist Accessories from being hit. because im checking which Limb gets hit to deal damage, which can cause issues with players that have lots of hats. Any ideas?

You can make a for i,v loop to get every accessories in the workspace.

local GetTable = {}
for i,v in pairs(workspace:GetDescendants() ) do
if v:IsA("Accessory") then
table.insert(GetTable,v)
   end
end
local Params = RaycastParams.new()
Params.FilterType = Enum.RaycastFilterType.Blacklist
Params.FilterDescendantInstances = {} -- put the getTable instead of a new table

1 Like

Thanks! works great for what im doing

I meant to put GetTable on the Params.FilterDescendantInstances part unless you already knew that but just in case.

yeah, did that and it works. Thanks

I have a sugestion: add teams management to the hitbox, it will make it more abrangent and less user-code dependant, so it would automatize raycast params and groups based on the setted teams relations.

Sometimes the OnHit function just doesn’t register. Here’s a vid of it happening quite a few times:

https://gfycat.com/playfulviciouskakarikis

I thought I might have too few DmgPoints but adding more doesn’t seem to fix it sadly.

Anyone know why? How can I fix this?