I’m trying to make the exit code for my game, but the script.parent.touched doesn’t work. It’s supposed to detect when a plank is touching it but even if it gets touched by anything else it still doesn’t say it was touched.
script.Parent.Touched:Connect(function(hit)
print(hit.Name)
if hit.Name == "Plank" then
script.Parent.Parent.Broken.Transparency = 1
script.Parent.Parent.Normal.Transparency = 0
hit:Destroy()
script.Parent:Destroy()
end
end)
make sure all colliding parts are actually touching and the both have CanTouch set to true. is there is a chance that they may appear to be touching but not?