|
| 03 Nov 2017 03:19 PM |
unfortunately the function Part:GetTouchingParts() only returns all of the parts that are inside of the given Part; What I need to figure out how to do is get all parts that are bordering the given Part (i.e. a surface of a Part is touching a surface the given Part), and I need to know which touching surface of each part is (i.e. its NormalId).
Is there a function for this? or are there any methods to accomplish this? thanks |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2017 03:49 PM |
| bumpo bump bumpb umbpsdgfv help me |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2017 03:53 PM |
You could create a slightly expanded Region3 and use FindPartsInRegion3; http://wiki.roblox.com/index.php?title=API:Class/Workspace/FindPartsInRegion3
Then a bit of math and you can find your surfaces |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2017 11:27 AM |
thanks @0supa
but someone please explain to me the kind of math i will need to use to determine bordering surfaces? |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Nov 2017 01:07 PM |
| You don't need arithmetic for detecting parts in a region3. |
|
|
| Report Abuse |
|
|
Quasiduck
|
  |
| Joined: 28 Sep 2008 |
| Total Posts: 2437 |
|
|
| 04 Nov 2017 05:35 PM |
Took a while. Put this in the part you want to get bordering parts for.
pasta bin /ZGzuB9CJ
My 3rd most complex script ever written...
pasta = paste
|
|
|
| Report Abuse |
|
|
Quasiduck
|
  |
| Joined: 28 Sep 2008 |
| Total Posts: 2437 |
|
|
| 04 Nov 2017 05:49 PM |
| It can be slightly inaccurate if the two parts have a huge difference in size. |
|
|
| Report Abuse |
|
|
Quasiduck
|
  |
| Joined: 28 Sep 2008 |
| Total Posts: 2437 |
|
|
| 05 Nov 2017 08:50 AM |
pasta bin /uzTre74H
Now 99.9% accurate. Fixed.
You'll notice that it creates a detector part. Only all parts that are inside that detector part (not on the surface) will be detected.
The detector part is in the same position as the original part you want to test but is slightly bigger so that it detects the region "around" your original test part. (Your original test part is the part you want to see for which other parts are touching.)
This created detector part is invisible and non-collision so it won't be seen or felt. However, it is also anchored and does not move with your original test part. |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2017 09:34 AM |
| thanks a lot quasi! im not very smart with vector product maths atm so i really appreciate your help. |
|
|
| Report Abuse |
|
|