:GetTouchingParts Broken

Hello! so i tried to make an automatic door and the :GetTouchingParts() function does not work ! when i walk on the detect part, it dosent even change the part count number (touching part count)

code :

cap2

I am not 100% sure on what you are trying to do, but I would recommend using .Touched to detect if the player has touched a certain part.

script.Parent.Detect.Touched:Connect(function(hit)
   if hit.Parent:FindFirstChild("Humanoid") then
     --Code Here
   end
end)

BasePart:GetTouchingParts() requires you to connect its Touched event so it can create a TouchInterest. That is exactly what it is implied on the API page.

1 Like