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

Is there a possible way to get the touching parts of a part that are non-cancollide?

Trying to do a music system based on what part the player is touching, and I can't seem to get the parts it is touching because the Part is CanCollide. I tried using something like this, but that didn't work. Any help would be awesome!

1 comment

0

No

1 answer

Hello,

I recommend you get the magnitude of both parts, then check to see if they are overlapping. This will check if the parts are inside of each other, and with subtraction you can check if they are just outside of the part.

--From roblox Wiki (http://wiki.roblox.com/index.php?title=Magnitude)
local magnitude = (part1.Position - part2.Position).magnitude
print(magnitude)

I use magnitude a lot in my projects. This will work, if you script it correctly! :P

Please post what you get when you get the code right! It will help more users.

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