I'm wondering how I can get a non-CanCollide part to detect if a player is touching it, but I don't really have any idea how to do this. What I do know is that this is going to use a local script.
COMMUNITY QUESTION
How do I detect if a player is touching a brick that has CanCollide set to false?
1 answer
A Touched event still fires even if CanCollide is set to false like so:
script.Parent.CanCollide = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then -- checks if a player is touching it
print("Hello World!")
end
end)
-- output --> Hello World!
Hope this helps and have a great day scripting!
Edit 1:
script.Parent.TouchEnded:Connect(function() -- TouchEnded is the way to go
end)
6 comments
0
It does not matter what script you are using.
0
However if you are using filtering enable and you are using a local script you will need to use remote events.
0
this is not a request website I will not write the entire script for you
0
And by the way. Why would you use a local script?
0
Local scripts should only be descendants of the player
0
Ok, thanks. Also wondering how to detect if player has stopped touching the part?
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Don’t use a local script. You can’t capture the touched event from the client.
I edited my answer for you.
if I helped you out please accept my answer. Otherwise comment how I can help you better