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:
local tank = script.Parent local debounce = false for i = 1, 100 do tank.CFrame = tank.CFrame * CFrame.new(0, 0, -1) wait(0.1) end local function onTouch(hit) if debounce == false then debounce = true if hit.Name == "Wall" then print("yes") end end end 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?