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.
what the hell is happening, help
(Sorry for the low quality)
I’m confused, I don’t see something wrong, unless you’re talking about the animation. The hitbox seems to be doing its job, but the animation is jittering.
The jittering of the animation is just the lag of the recording, the problem is that sometimes I hit an npc that is like 1 stud from the hitbox
You can see it cleary in the first video
here’s an image of the problem
awesome!
Helped greatly with my game
Can anyone help me with this?
idk why but for some reason the raycast hitbox is bigger than the rays
Editted: I already found a solution I was just being lazy and did it completly wrong lol.
Great module it’s really really handy and it really helps me getting into melee combat stuff! Thanks for this awesome module!!!
Is there a way to detect if you hit a part without a humanoid? For example here’s a script I’m trying to do that with:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RaycastHitbox = require(ReplicatedStorage.RaycastHitboxV4)
local swordHitbox = RaycastHitbox.new(script.Parent)
swordHitbox.OnHit:Connect(function(hit,humanoid)
print("hit")
local model = hit.Parent
print(model.Name)
if model.Name == "Burger" or model.Name == "Taco" then
if model.ClassName == "Model" then
local health = model:GetAttribute("Health")
health = health-100
model:SetAttribute("Health", health)
end
end
end)
while true do
swordHitbox:HitStart()
wait(3)
swordHitbox:HitStop()
wait(3)
end
Shouldn’t Taco be +100 because they are yummy?
Is anything showing up in output?
What is it you are hitting?
Are all models going to have health in them? Or does it error out when you click a model without Health?
If you add a print statement debug inside of the if, does it print when you whack a taco?
Nothing is showing up in the output. I am hitting a part in the model, which should either be named Taco or Burger. Only the Taco and Burger models have a health attribute. It’s not even printing the hit at the beginning. Is what I want to do not even possible with the current version?
How do I access this? I don’t see any documentation in the script.
Is there a way to make hitboxes detect each other?
When the fps is lower, or if you are spinning, the hitbox size is increased for some reason.
GetHitBox isn’t quite working
local ray = require(game:GetService("ReplicatedStorage").RaycastHitboxV4)
local parti = script.Parent:WaitForChild("Part")
local a = ray.new(parti)
a:SetPoints(parti, {Vector3.new(1,1,1)})
ray.new(script.Parent)
wait(1)
local dog = ray.GetHitbox(parti)
print(dog)
It prints nil.
I’m having a quite troubling issue with the module. It seems that the raycast hitbox lags behind with movement (ex. player moves left and right while swinging a sword, the raycast hitbox will lag behind.) This even seems to happen in the example place. Is this a problem with the module itself, or can I fix this somehow?
https://i.gyazo.com/8610e253c092fb43eabd4d8bbcfd9878.mp4
https://i.gyazo.com/454ed144d558468f83be13fc93e68997.mp4