I know this is a really small and probably obvious question, but I haven't found a solution to this and this has happened more then once.
I am testing out a cassette player which detects when the cassette hits the Part. I made a simple script that connects Touched to a function which prints hit, hit.Parent, and hit.Parent.Parent then prints "END", in order to test what the script would call the cassette.
The issue is that the code doesn't output anything except "END". Both objects have CanCollide on, and the cassette is unanchored.
Is there any reason why the script isn't printing hit? And if so, can and how would I go about fixing it?
script.Parent.Touched:Connect(function(hit) print(hit) print(hit.Parent) print(hit.Parent.Parent) print("END") end)
Hit is a reference to an instance, so you have to use Name
script.Parent.Touched:Connect(function(hit) print(hit.Name) print(hit.Parent.Name) print(hit.Parent.Parent.Name) print("END") end)