We use RaycastHitbox extensively in our current project (PWNED 3, from which some of the images in the OP come from). I could probably take this up part up with Phin since we did touch on GitHub (and Rojo) and may potentially also releasing other resources for developer use.
* Rojo was brought up internally as something to look at, but not sure if we’re moving over.
Also, noticed you brought GitHub up a few times lol. I think it’d be awesome to have this up on GitHub as well. Appreciate the heads up and enthusiasm.
I’m still learning the crux of github but so far it seems pretty straightforward. I haven’t fidgeted around with any of the permissions yet so do let me know if there is anything else that needs to be done.
Why aren’t the attachments following through with the arm?
Rays are being cast server-side, would that be an issue?
Also, the animation doesn’t play the server-side…
So if I played it on the client, it would work, I assume?
Animations not playing on the server side is the problem yes. Since the attachments are also on the server, it won’t move because its following the animations on the server. It will be fixed if you move it client sided (assuming that model is a player). Remember to do server side sanity checks if you do.
An example of basic sanity check is: make the client do all the hit detection with this module. Once the client hits a humanoid, send a remote event to the server essentially telling the server to damage this humanoid it hit.
The server won’t immediately damage the humanoid. Instead, it will verify first if it is valid. A simple way is to do a raycast between the hit humanoid and the player that called the remote event. If there is a wall between them, don’t damage the humanoid (because you’re not suppose to damage stuff through walls anyway!) Another sanity check you can combine it with are magnitude/distance checks. If the player says to damage a humanoid but that humanoid is 500 studs away, this is already a red flag. It’s basically just seeing what makes sense in your game and making sanity checks according to that. I recommend searching around the devforum as well for what makes good server side security against exploiters.
Hello! I’m here to ask on how it works, because I’d like to make my own one so I can understand the script. I used to use touch event which is know for being a unreliable way to do so, so I wanted to try this, but i can’t find any examples of how it functions. Thank you in advanced!
In all honesty, I have never heard of developers using Region3 as a hitbox for melees. I’ve just started learning the basics of Region3, and that sounds insanely complicated and too complex.
It makes sense given what it does, but it just sounds like too much work and impractical.
The sample roblox place provided in the original post has a link attachments example. I wouldn’t recommend using it over the normal raycasting system if you are using it for swiping melee attacks, but it has its niche cases.
An example code can be:
local RaycastModule = require(RaycastHitboxModule)
local Hitbox = RaycastModule:Initialize(workspace.Part)
local Attachment1 = Instance.new("Attachment", workspace.Part)
local Attachment2 = Attachment1:Clone()
Attachment2.Position = Vector3.new(0, 20, 0)
Attachment2.Parent = workspace.Part
Hitbox:LinkAttachments(Attachment1, Attachment2) --- Links a raycast location between the two attachments
Hitbox:HitStart() --- Starts the damage logic, will continually raycast between the two points defined above
basic hand-hand combat, i felt that in this case linkedattachments would be more suitable for my needs… little did i know it came out better than i expected.
me and alot of others really appreciate this module, keep doing what you’re doing.
So, I was making this Module work with my game and I stumbled upon something weird, in the API it says " RaycastHitModule:GetHitbox" but what is “RaycastHitModule” since when we’re talking about the main module, above it’s referred to “RaycastHitbox” I tried using the function GetHitbox() on the “RaycastHitbox” module but it returns a nil value, even though the hitboxes initialize successfully. Please help.
Its an old function that I forgot to add back in when I revamped the module. The newest version, v2.2 is available on my github that fixes the missing function so you can download it there. I will update it on the actual site soon.
Ok, so I stumbled upon another weird thing, when I initalize the hitboxes that I’m going to use, and call them using the :GetHitbox() function, it creates them again? I only call the initalize function once, and when I execute the attack it warns me that “This hitbox already exists”, even though it’s not initializing it again. I’m using Hitbox:HitStart() and Hitbox:HitEnd() only, so I don’t know what causes this issue. This glitch is very problematic, since it creates the Hitboxes, and they stack over and over dealing progressively more damage upon reaching the point of a one shot kill.
Doesn’t sound like an issue with the hitbox function but are you forgetting to disconnect the OnHit when you are done with HitStop()? You are creating a new thread when you run the connection line but it is difficult to diagnose if you don’t provide sample code.