Detecting with moving hitbox

So I’m trying to make a hit box with an ability in my game that dashes with the weapon and hits any player in front of the player using the ability.

I’ve tried some basic hitbox stuff where I weld a part and use touch events but it doesn’t detect as it moves. I think I would have to use a GetPartsInPart or GetPartBoundsInBox function but I’ve never used this and I’m not too sure how to use it with my ability in my game.

an example would be very appreciated or any help at all. Thanks.

My Ability

1 Like

You could ray cast directly in front of your character and depending on whether it hits something or not, if it does then you could check the distance between the hit part and the ray. If the distance if between 10-15 studs then you probably hit a player using the hammer.

Maybe at the end of your animation you could fire the ray so you don’t do it to early on.

I suggest handling the ray casting on the server

1 Like

i think you should use raycast hitbox or muchacho hitbox.
.touched event isn’t good at detecting anything

1 Like