Torso only triggers onTouched function

Hello, I’m trying to make it so when a part is touched it ignores when the arm touches the part and only activates when the torso touches.

However, I have no clue on how to do this. Please could someone help me. Thanks!

Just check the name of the part that triggered the event

Part.Touched:Connect(function(hit)
    if hit.Name == "UpperTorso" and hit.Parent:FindFirstChild("Humanoid") then
        print("Hit a torso of a player")
    end
end)

This should work well.

1 Like

I tried this, and it didn’t work. The print didn’t appear in the output when I touched the part.

Alright. Let me test it in my studio.

Just had to rename the Name property for the torso.

If you’re using R15 then Torso is actually split into Upper and Lower Torso. So in that conditional, you need to check for both names.

Depending on your use it may be better to use HumanoidRootPart over UpperTorso and LowerTorso

Yes, when I tried the UpperTorso it didn’t work but the HumanoidRootPart did work.

Thanks for the help. :slight_smile:

Well I did test with UpperTorso it does work but the collision boxes just rarely hit.