How do I use .Touch when both objects are non cancollide?

I am trying to use .Touch when both objects are non cancollide, but, it doesn’t work. Any other ways?

2 Likes

wait do you mean the function onTouch()

cause if you do mean onTouch()

i think the function still works even if the parts cancollide is false

sorry if im wrong :grimacing:

im using part.Touched:Connect(function()

can you tell me what your trying to do with the touch function and the script so i can help

script.Parent.Touched:Connect(function(hit)
if hit:FindFirstChild(“isgripped”) then
if hit.isgripped.Value == true then
–code here
end
end
end)

script.Parent.Touched:Connect(function()
--script
end)

Do you have this?

Yeah i have that and thats in a localscript too

LocalScript isnt working. Only an normal script.

the thing i need it to touch is in the client side

the thing i wanna touch a part with is only on the client side

You can have the server detect the touch and fire a remote event to the player who touched it.

maybe you could try

if hit:FindFirstChildIsA(“isgripped”)

sorry if I’m wrong :grimacing:

I’m fairly new to lua

LocalScripts will work for this, so long as the LocalScript is in a player’s character, PlayerGui, PlayerScripts, or Backpack.
It will not run if it is in Workspace.
How do you have this set up?

1 Like

this is the one im trying to do

External Media

Those parts looke like they are not moved by the physics engine. By that I mean that they look to be CFramed around by the game. If that’s the case, then Touched won’t work. I’m not sure if GetTouchingParts in a loop will work, but if Touched doesn’t do the trick then you could try it.

1 Like