Raycast Hitbox 4.01: For all your melee needs!

Hiya, owner of ClientCast here.
The reason that ClientCast does not offer any built-in methods is because there is no “one-size-fits-all” solution; I do not provide any custom debounces or filtering in the module directly to allow for the developer to have as much customizability as possible - ClientCast is designed with minimalism & maximum customizability in mind. You can see it stated on the thread, too:

Overall, I believe that this module is more useful for beginner programmers than ClientCast; it offers a lot of built-in features that you mentioned, which also becomes the downfall for more professional programmers.

4 Likes

Absolutely - here’s an in-depth demo place I made for you to look around (uncopylocked ofc).

You can switch between both RaycastHitbox and ClientCast modules to see for yourself what I mean by ClientCast being slightly more reliable in collision.

Also there’s an option to move your player to a specific CFrame that I found to be a bit buggier than others, but but you can move around yourself in any angle you’d like as well.

Also, it’s worth to note that I did personally try switching to PartMode and Bypass (implementing my own humanoid debounce in the process) but I ran into the same problems as it did for Default mode (i.e. OnHit event not firing at all sometimes). The place below is set to Default mode:

https://www.roblox.com/games/7478862830

Lemme know if there’s any issues with this place / if you need any additional explanations!

1 Like

I am having the same difficulty to save time here is a shot of my Explorer panel. I have tried many things to get this to work but no luck. I have found that it ‘appears’ to not be creating the destination Vector3 values for the raycast in the Attachments solver. But that may just be misleading.
image

Hello, I have no experience using raycasts and thats why I decided to use this module, But I have encountered an issue, This video shows the issue ive encountered Weird Raycast Glitch - YouTube
I installed the module just like the website said so but for some reason my raycast does not appear to be positioned on the attachment for some reason, But for some other reason this unequipped tool appears to not have the issue, Theres also nothing on the output related to it, I need help, I have been trying to find a solution to this but I can’t.

Hey, thanks, this was really helpful! Took me a while to dig my teeth here since life things but finally got around to see where the problems are and this place really helped me visualize what the problems were so thank you again.

The fix was really stupid; it was just a one-liner change and I just dun-goofed on it lol. I will upload the fix later today.


@CCTVStudios This can be caused by if you are teleporting the player/weapon on the server-side. The server sees the weapon at a different location than the client. See if the server is looking at a different position.

1 Like

V.4.01 Stable

Credits to @bagwan12345 for solving this issue (let me know if it still has inaccuracy issues when you update!). There was about a 1/8 chance the hitbox will fail to find a target. It should now find and detect all hits correctly. If you were/are experiencing any inaccuracy issues, please update your module to 4.01. This issue affects all versions of RaycastHitbox.

GoodSignal

The module now uses GoodSignal which takes advantage of Roblox’s not-so-new-anymore task library and performance improvements.

New Feature: Signal Types

You can now set if you want to use Single listeners (default RaycastHitbox behaviour) or to Default (default Roblox behaviour). More information can be found below:

local hitbox = RaycastHitbox.new()
hitbox.SignalType = RaycastHitbox.SignalType.Default

RaycastHitbox defaults to Single listener type as it is the easiest for beginners to use this module, however, it promotes bad coding practices.


Where to get this new version??!!

The cool kids club:

The cooler kids club:

13 Likes

Whenever I try and make a hitbox it says

Make sure you are using a period ‘.’ and not a colon ‘:’. If it still happens, please provide code you are using that exhibits this error.

Did you require RaycastHitbox?

Can you show the whole script? It should work if those suggestions are fine. Redownload the module maybe?

Its super duper messy sorry about that

local swipe = script:WaitForChild("swipeAnim")
local RaycastHitbox = game:GetService("ReplicatedStorage"):WaitForChild("RaycastHitboxV4")
local debounce = false
local swipeEvent = script.Parent:WaitForChild("Swipe")
local RS = game:GetService("ReplicatedStorage")
local Handle = script.Parent:WaitForChild("Handle")

swipeEvent.OnServerEvent:Connect(function(player)
if debounce == false then
		debounce = true
		local hum = player.Character:WaitForChild("Humanoid")
		local animator = hum:WaitForChild("Animator")
		local loadedswipeAnim = animator:LoadAnimation(swipe)
		local hitboxPart = Instance.new("Part",player.Character)
		hitboxPart.Size = Vector3.new(0.293, 1.079, 5.616)
		hitboxPart.CFrame = Handle.CFrame
			hitboxPart.Name = "hitboxPart"
			hitboxPart.Transparency = 0.75
			hitboxPart.Anchored = false
		local hitboxWeld = Instance.new("WeldConstraint",hitboxPart)
			hitboxWeld.Part0 = hitboxPart
			hitboxWeld.Part1 = Handle
		local trail = Instance.new("Trail",Handle)
		trail.Attachment0 = Handle:WaitForChild("TrailAtt1")
		trail.Attachment1 = Handle:WaitForChild("TrailAtt2")
		
			loadedswipeAnim:Play()
		local hitdebounce = false
		local raycastedHitbox = RaycastHitbox.new(Handle)
		raycastedHitbox:HitStart(2)
		raycastedHitbox.OnHit:Connect(function(otherPart)
		if Handle and hitboxWeld then
			if otherPart.Parent.Humanoid and hitdebounce == false and not otherPart.Parent.Name == player.Name then
				hitdebounce = true
				local hum = otherPart.Parent.Humanoid
				local damagetoTake= math.random(10,15)
				hum:TakeDamage(damagetoTake)
				local hitNotifier = RS:WaitForChild("DamageNotifier"):Clone()
				hitNotifier.Parent = hum.Parent.HumanoidRootPart
				hitNotifier.StudsOffset = Vector3.new(math.random(1,3),math.random(1,3),math.random(1,3))
				hitNotifier.TextLabel.Text = damagetoTake
				print(player.Name.." slashed "..hum.Parent.Name)
				hitboxPart:Destroy()
				task.wait(0.5)
				hitNotifier:Destroy()
				end
			end
		end)
		task.wait(2)
		hitboxPart:Destroy()
		trail:Destroy()
		task.wait(1)
		debounce = false
		hitdebounce = false
	end
end)

I’ll try redownloading

Edit: OH I FORGOT THE REQUIRE SORRY

:sweat_smile: :+1: Sounds good, no problem.

1 Like

Wow yeah, it seems to work perfectly now! Thanks for the quick fix + all your continual updates on this module! :heart:

1 Like

Thanks for the help, Apparently you were right, The server wasn’t replicating what the client was doing, This is apparently a studio bug that has been arround since june 15 Animations for parts attached to characters with motor6ds not playing for other players It makes desired angle not replicate and also breaks the whole thing. Hope it gets patched, For now ill try to find a way to work arround this

1 Like

Is there a convenient way to automatically create HitPoint attachments on a part? Better yet, on a player character?

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