What is my goal?
I am trying to have a touch functions that constantly updates whether the right leg or left leg is touching the ball.
I assume :GetTouchingParts() is the right method to accomplish this however the variables keep getting set to false and is never true even when i hit the ball with my leg.
function touchFunction(hit)
if hit.Name == "Ball" then
local t = hit:GetTouchingParts()
if table.find(t, 'Right Leg') then
rightLegIsTouching = true
else
rightLegIsTouching = false
end
if table.find(t, 'Left Leg') then
leftLegIsTouching = true
else
leftLegIsTouching = false
end
end
end
Player.Character[currentFoot].Touched:connect(touchFunction)
Any help is appreciated.
Merry christmas to you all.

1 comment
LeftLeg and RightLeg do not have spaces in their name and also you can't use string in table.find in this case because there is no strings in this table, only Instances