Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What does the argument on the ontouched function link to?

So I have this little snippet of code here and I am just curious as to what indexes when this code is run:

script.Parent.Touched:Connect(function(hit)
end)

What does the hit link to? Thanks!

4 comments

0

When you call hit I this function it will refer to the part that touched script.parent

0

Try putting print (hit.Name) in the function

0

And then walk onto the part the script is in

0

Will do, thank you!

1 answer

The first parameter of .Touched given (a.k.a. hit) returns a part that touched the object.

This discussion is preserved as it was. New answers, comments, and votes are closed.