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

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

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

1 comment

0

Please explain better

1 answer

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;

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