Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

What does the argument on the ontouched function link to?

Asked by 4 years ago

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!

0
When you call hit I this function it will refer to the part that touched script.parent OBenjOne 190 — 4y
0
Try putting print (hit.Name) in the function OBenjOne 190 — 4y
0
And then walk onto the part the script is in OBenjOne 190 — 4y
0
Will do, thank you! spot6003 64 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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

Ad

Answer this question