Hey just thought I’d let you know. The documentation in the module includes a “GetHitbox” function which doesn’t exist in 2.1. Here’s the addition I added to the main module for the time being (it causes a warning in check to be fired so I commented that out as well).
function RaycastHitbox:GetHitbox(object)
return Handler:check(object)
end
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.