Raycast Hitbox 4.01: For all your melee needs!

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
image

awesome!
Helped greatly with my game :+1:

Can anyone help me with this?
idk why but for some reason the raycast hitbox is bigger than the rays
image

5 Likes

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?

3 Likes

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

i think thats how the vizualizer works

I’m not too experienced with this module but I believe this lag is because you are running it on the server instead of the client. Make sure to implement a sanity check if you decide to switch from server to client.

any way to return the vector3 position where the raycast hitbox and part collided?

Why is your previous implementation bad? Could you give an explanation.

anybody else having a issue where the raycast go way farther than the attatchments?

nevermind i fixed it, i had another hitbox that was larger interefering with it

I want to switch to a single solution to keep it as a permanent solution and for accuracy, so I don’t have to resize hitboxes for every animation. Should I use ‘this’ or ‘overlap params’? Currently, I’m using ‘overlap params,’ but I’m concerned that the ‘raycast’ module would be laggy, based on what I’ve heard. Please advise me only if you’re knowledgeable or have past experience with this. Also, I don’t think I’m going to mix both of the modules because it wouldn’t behave efficiently.