Hi, im making a script in which if u touch a part, a function gets executed.
Now, ive used :GetTouchingParts to make the script more stable and accurate.
Here is my code for the script.
while true do
wait()
local Touch = PreviewButton:GetTouchingParts()
local Character1 = nil
for i,v in pairs(Touch) do
print(v)
if v.Parent:FindFirstChild("Humanoid") then
Character1 = v.Parent
elseif v.Parent.Parent:FindFirstChild("Humanoid") then
Character1 = v.Parent.Parent
end
end
end
and for some reason the PreviewButton does not detect the player’s parts as u can see here.
https://gyazo.com/34a092efa7cc2cd3ea2a16f013f8ce6f
It only detects the button that is situated in middle of the PreviewButton.
Is there anything where :GetTouchingParts() doesn’t detect character parts? I dont think ive disabled my characters can_collide.
Am i doing something something wrong or :GetTouchingParts() does not work on the Character parts?
Im really confused here so it would be awesome if someone would help me.
Regards, SpacePyro