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

I'm trying to make a part detected a other part. Can someone help?

Asked by 4 years ago

I have made the wheel but I need a way to detect player its facing. There are 4 Seats. I have placed Walls behind the seats, all I now need is a way for a part detect what part it's touching.

Here a picture Chooser is the part what needs to detect one of the walls. https://www.roblox.com/library/4810574373/Spinner

Thank you! -Xi

0
Please explain better Spjureeedd 385 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You could use :GetTouchingParts()

Example of it :

script.Parent.Touched:connect(function() --// when your part is touched
    local touching = part:GetTouchingParts(); --// returns a table with the touching parts
    for _, p in next, touching do
        print(p.Name..' is touching '..script.Parent.Name);
    end;
    print();
end;
Ad

Answer this question