Raycast Hitbox 4.01: For all your melee needs!

Whenever I teleport the tool, or the player with the tool even though it shows in the workspace that the attachments are still on the tool it shows the raycasting done from far away, how do I fix this?

https://gyazo.com/c41b41549aad3299d8ad0f3098edf1c1

Im having a different issue here - every time the player dies, the attachments for the weapons are stacked on top of each other:
image
It causes the onhit effects to run multiple times on a single swing, is there any way i can prevent this?

edit: fixed lmao it’s something really dumb

02:27:45.189 ReplicatedStorage.RaycastHitboxV4.HitboxCaster:286: attempt to compare string <= number - Server - HitboxCaster:286

How do i fix this?

Is anyone having a issue when you use :HitStart() it’s not gonna do damage at all?

Hello, is there any way to make it so this doesn’t only trigger on humanoids?

image
image

Anyone else had this error?

Just a question, why are you repeatedly destroying a hitbox? If you are trying to turn on and off a hitbox, you can use HitStart and HitStop. Otherwise, I’m not sure why this error would occur.

Change the DetectionMode of the hitbox.

Weird, I’m not sure then. Since the error occurs because of it colliding with another hitbox, it must be a bug with the module. Swordphin’s bio reads “OUT OF DEVFORUM DUE TO SOME LIFE STUFF. May be slow to respond.” so you are likely not going to get a response, unfortunately.

hey do you think you could possibly help me? Whenever I teleport the tool, or the player with the tool even though it shows in the workspace that the attachments are still on the tool it shows the raycasting done from far away, how do I fix this?

https://gyazo.com/c41b41549aad3299d8ad0f3098edf1c1

Is it only visual or is the raycast actually offset that much?

Im having a problem with RayCastParams. here is my script:

local RayC = require(game:GetService("ServerScriptService").RaycastHitboxV4)
local partDetection = RayC.new(part.Parent.Collide)
	
local RParam = RaycastParams.new()
RParam.FilterDescendantsInstances = {game.Workspace.Folder}
RParam.FilterType = Enum.RaycastFilterType.Blacklist
	
partDetection.RayCastParams = RParam
partDetection.DetectionMode = 2
	
partDetection:HitStart()
partDetection.Visualizer = false

the script still returns objects within the folder I specified not to return from.

The raycast is actually offset

It only happens after I teleport the player or the glove

Yes. I used this, works great.

In our previous implementation we were destroying hitboxes to avoid overloading the client with non usable parts. We have a fair amount of melee weapons in our game and I thought it would be optimal to destroy the raycast hitboxes after a hit. Was that mindset wrong??

So you are creating a hitbox to check for a hit, then destroying it when it hits, then creating another one?

There’s a huge problem with RaycastHitboxV4 and its OnHit bindable.

When you print the name of the part hit in the module, and then print what it receives in a localscript, it will not return all parts that the module found and hit, therefore missing a good chunk of what the raycast actually hit

RaycastHitboxV2 has a more responsive OnHit bindable for some odd reason, as I’ve experimented with; Compared to RaycastHitboxV4, V2 will return EVERY single part it hit from the module to the localscript. Why is that?

Also, if anyone has trouble getting responsive hits with swordphin’s hitbox, consider replacing the raycast with GetPartsBoundInRadius for each attachment, it’ll become much more responsive than raycasts due to the slightly extra detection range

I edited swordphin’s V2 version below with GetPartsBoundInRadius for anyone who wants to test
SwordphinMagnitudeHitboxV2.rbxm (8.8 KB)

In the previous implementation it was like this, we were creating a part in front of the player, damaging players that were into it and then destroying that part, but that was a really bad idea for hitboxes that’s why we decided to choose this module.

I followed the same mindset, but we ended up with that error, and a playtesting session we had ended up with the game crashing. Based on your previous comment, now I’m activating the rays (HitStart) when the power is cast (i.e. when someone is swinging the sword) and then stopping the rays (HitStop). Didn’t see the bug appearing again but we might have to do another playtesting session with lots of people.

1 Like

what the hell is happening, help
(Sorry for the low quality)



2 Likes