TouchedEvent dont work

‘sry for bad english’

Hello everyone :smiley:

My problem is:

The Touched event for my control brick is not working

(Control brick = player is controling a part)

The Control script for the Part is :

(forward)

Control.Position = Control.Position + Vector3.new(1,0,0)

It works , but when it touches a Part with this script:

script.Parent.Touched:Connect(function(t)

print(t)

end)

Nothing happens

plsss help

:smiley:

I know / think its because the Part is only changing the position

Make sure you use LocalScript also if you want player to touch the brick then you should check if in variable ‘t.Parent’ exists Humanoid. I hope this helps. :herb:

Example for on player touch:

script.Parent.Touched:Connect(function(t)
 if t.Parent:FindFirstChild("Humanoid") then
  print(t)
 end
end)

This is not that what I need , but thanks :smiley:

It’s highly not understandable what are you actually trying to achieve to be honest with you. Can you describe your problem a little bit more understandable, please?

The touched event dont “trigger”

If it’s only on the changing of the Position then you could :Connect upon :GetPropertyChangedSignal("Position") and get the Touching parts:

script.Parent:GetPropertyChangedSignal("Position"):Connect(function()
    local touching = script.Parent:GetTouchingParts()
    for _, v in ipairs(touching) do
        print(v)
    end
end)

Note: GetTouchingParts does not include non-collidable parts, however there’s a special trick of how you can do so here:

1 Like