How can check If Player hand Punched a Part?

I did a punch animation, and I want to know a way (as light and lagless as possible) to check if the player’s hand punches a Part (which I made is a giant stone, so it’s a meshapart), the reason why I want it to be light because it’s going to have a lot of areas to punch, so I’ll need to check all areas every time players punch

I looked for some alternatives but they told me that they cause a lot of lag, so I need a solution with as little lag as possible

1 Like

Just doing a Touched event on the player’s hand, pretty much as light as it’s gonna get.

2 Likes

Alternatively to what @Lua_Basics said, you could probably use rays but this would require more calculations. If you wanted your punching thing to be “physics” based then using touched most likey will be your best bet.

But touched event active with ever part of humanoid

Which is why you implement checks to make sure it’s a player

it shouldn’t unless it has something to do with your punch animation (how it’s made)

I know, but i only check If the Hand Punched, not ALL the body

Then test if the name of the part is the right hand/left hand…

How do that, i dont have idea, i never did something like that, like player.humanoid.hand?

LeftHand or RightHand of a player is a instance of the character, player.Character.LeftHand so you would set up a touched event with:

local Character = player.Character or player.Character:Wait() --- to ensure that the character has loaded first
local LeftHand = Character.LeftHand -- Left Hand of the player

LeftHand.Touched:Connect(function(Hit)
       ---Do whatever
end
2 Likes