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

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

Asked by
znepb 17
6 years ago

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!

0
No Overscores 381 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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.

Ad

Answer this question