Hello, I’ve been trying to create an FPS framework and I’m currently trying to create a hit detection system but I’m not completely sure about where to start. I’ve tried to look for solutions on the dev forum but I’ve had no luck finding one. If you have any tips on how to do so, then please reply to this topic!
Is this what are you looking for?
Okay, so I fixed the RemovePoints by making it check for MeshParts as well in the if condition. The R15 body parts are MeshParts, which is why it didn’t execute the rest of the function.
Here’s the fix:
function Hitboxing:RemovePoints(partInstance, vectorPoints)
if partInstance then
if partInstance:IsA("BasePart") or partInstance:IsA("MeshPart") then
for _,Points in pairs(self.Points) do
for _, vectors in ipairs(vectorPoints) do
if typeof(Points.Attachment) == "Vector3" and Poi…
Yes, thank you for showing me this!
I have been reading this for a bit and I don’t think this will work for guns. Can you correct me if i’m wrong?
Ooh, you want guns, then check this:
This is not in the 1st part thanks to the devforum having issues with longer posts. Firefox crashed twice at the end of the previous one.
This part covers equipping, reloading, and firing the gun. It’s the last part.
1. Smooth value module
I wrote it myself. It’s useful for making movement more smooth with less code. There are a bunch of functions once you create a smoothValue object, mostly :set() to set target, :get() to get it and:update() for the obvious updating.
The module: (Prepared f…
If you’re not interested on the whole tutorial and only want the Hit Detector, here’s the module you can use to achieve it:
Hi! Love that you have created this and provided all this extra info on how to use it.
I’m having trouble with running FastCaster:Fire() once but receiving two FastCaster.RayHit:Connect(OnRayHit) back.
Edit: Fixed it!
The problem was that I was having the server script in each gun, listen for the SendHitEvent. This event was in ReplicatedStorage, so every server script in every tool would damage the hit player once one of the players sent the SendHitEvent. I fixed it by moving the event insid…
Thank you, I will take a look now.
Are you looking to make a hitscan system or projectile system? Both have advantages and disadvantages. Here’s a wikipedia article on Hitscan if you are interested.
Hitscan in video game design, most commonly in first-person shooters, is a type of hit registration system that determines whether an object has been hit or not simply by scanning if the item used was aimed directly at its target and then applies the effects of the item (usually damage) instantly. A weapon, for example, does not launch a projectile the player needs to lead, damage is applied as soon as the player's crosshair is on a target and the fire button is pressed. Internally, this is most ...
In my opinion, Hitscan seems good in games that are arcade styled games while projectile could be used in a more realistic FPS. Though you could always mix these like Overwatch does. Overwatch has heroes that shoot with both projectile and hitscan.
I’m trying to use a projectile based system