What's the best Collision Type for an ability hitbox?

What’s the best Collision Type for an ability hitbox?

So basically, I made a hitbox for my attack.
But the problem is, the npc walks trough it and doesn’t get damaged.
It only gets damaged when he enters the hitbox and not when he’s already inside.

The code is just a simple 'CreatePart' function.

Any help?

you can use this.
https://developer.roblox.com/en-us/api-reference/function/BasePart/GetTouchingParts

1 Like

Okay.
But what can I do with this? any examples?

For example:

while explosionHitbox and task.wait(1) do
	for i, part in ipairs(explosionHitbox:GetTouchingParts()) do
		print(part.Name)
	end
end
1 Like

That’s cool and all, but I don’t see how it can make the hitbox better?

You can use it to damage players already inside the hitbox.

1 Like

hey sorry to bother but im making a combat system
and im testing with :GetTouchingParts() but the script that you put as an example dont work

im doing this 2 simple “scripts”:

	local Parts = HITBOX:GetTouchingParts()
	for _, v in ipairs(Parts) do
		print("HITBOX ACTIVE")
	end
	while HITBOX and task.wait(1) do
		for i, part in ipairs(HITBOX:GetTouchingParts()) do
			print(part.Name)
		end
	end

but didnt work

You shouldn’t use :GetTouchingParts for combat. Try using this:

No, raycast hitbox depends on the animation and this is a problem
im not good animating + the player needs to be moving + some moves need the tipical square hitboxes
anyway i fix that using :GetPartsInPart()
but the problem now is that the hitbox keeps active after finishing the move