|
| 04 Jan 2013 10:25 PM |
What would be the best way to find the most 'prominent' part in a region (Region3 to be specific)?
I know I could divide the region into sub-regions, but that would be double the amount of memory usage. Is there any better way? |
|
|
| Report Abuse |
|
|
jakej78b
|
  |
| Joined: 09 Mar 2011 |
| Total Posts: 813 |
|
|
| 04 Jan 2013 10:27 PM |
| Are you talking about the first part located within region3? if so then use game.Workspace.Region3:findFirstChild("Part") |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2013 10:29 PM |
| No. I mean the the part that is most (by size and how much the part goes into the region) in a Region3 (the datatype). |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2013 10:33 PM |
local ms, part = -1 for _, v in pairs(TableOfParts) do local s = v.Size.magnitude if s > ms then ms = s part = v end end
print( part, "is the largest part within the Region" ) |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2013 10:34 PM |
| Eh that only checks for size, not for how much it's sticking into the region. |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2013 10:35 PM |
Just what I needed, thank you!
Problem Solved. |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2013 10:36 PM |
| I can modify it for you if you want me to account for how much the part sticks into the Region. |
|
|
| Report Abuse |
|
|
|
| 05 Jan 2013 11:18 AM |
| No thank you. I think I can add that functionality. |
|
|
| Report Abuse |
|
|