Touched event doesn't work when two blocks touch one another?
Asked by
5 years ago Edited 5 years ago
So I have two parts and the idea is that one part is supposed to move towards another stationary part and print a message.My code looks like this:
01 | local tank = script.Parent |
05 | tank.CFrame = tank.CFrame * CFrame.new( 0 , 0 , - 1 ) |
09 | local function onTouch(hit) |
10 | if debounce = = false then |
13 | if hit.Name = = "Wall" then |
21 | tank.Touched:Connect(onTouch) |
One part, the 'tank,' moves towards the other part as intended, but when it makes contact it doesn't print any message. Any ideas on why this is?